* fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too. Don't
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 26 Jan 2006 22:12:26 +0000 (22:12 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 26 Jan 2006 22:12:26 +0000 (22:12 +0000)
attempt to open for write; this always fails, at least on POSIX
hosts.

lib/ChangeLog
lib/fts.c

index cdb731c140fbdc6ca48d9d0a9b508df5ea8586a0..e21d1cbec2cd5d5c33939e230f7f4b64c59b0522 100644 (file)
@@ -1,3 +1,10 @@
+2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fts.c (diropen): Open with O_NOCTTY | O_NONBLOCK too.  Don't
+       attempt to open for write; this always fails, at least on POSIX
+       hosts.  This reinstates the 2006-01-09 change, which was
+       inadvertently removed.
+
 2006-01-26  Bruno Haible  <bruno@clisp.org>
             Paul Eggert  <eggert@cs.ucla.edu>
 
index 152450f8c8afe176fa7a0bc3a33d6b3b080bb8e7..8666cff871ce1e185b4e5eeaad8e1a48b178f3cf 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 *