]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(diropen): Don't bother trying to open directory for write access:
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 Dec 2005 07:55:03 +0000 (07:55 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 Dec 2005 07:55:03 +0000 (07:55 +0000)
POSIX says that must fail.

lib/fts.c

index eb24b9862cc25e860eef9b4cd43bd79ba0b25d75..d119541efe4615d6fc2181fdbcaf9ccc4ff5ffb9 100644 (file)
--- 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 *