changeset 6618:6f335711be5e

* 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.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 26 Jan 2006 22:12:26 +0000
parents 2f05a671f15b
children 29248383a0c7
files lib/ChangeLog lib/fts.c
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -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>
 
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -203,10 +203,7 @@
 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 *