summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-12-27 07:55:03 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-12-27 07:55:03 +0000
commitcc4d59e9cd0a54118dc0f0dc833539102a42ea4a (patch)
tree7bf98d838ce7e83450ad9ebf76567ce143430a4e
parent8846a6bfdd11703c53d6bbb288b5f1fd74468143 (diff)
downloadcoreutils-cc4d59e9cd0a54118dc0f0dc833539102a42ea4a.tar.xz
(diropen): Don't bother trying to open directory for write access:
POSIX says that must fail.
-rw-r--r--lib/fts.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/fts.c b/lib/fts.c
index eb24b9862..d119541ef 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -203,10 +203,7 @@ static int
internal_function
diropen (char const *dir)
{
- int fd = open (dir, O_RDONLY | O_DIRECTORY);
- if (fd < 0)
- fd = open (dir, O_WRONLY | O_DIRECTORY);
- return fd;
+ return open (dir, O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
}
FTS *