From 2a9ab9df35a789599c9d5258689e512d0174c5fe Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 26 Jan 2006 22:12:26 +0000 Subject: [PATCH] * 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. --- lib/ChangeLog | 7 +++++++ lib/fts.c | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index cdb731c140..e21d1cbec2 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2006-01-26 Paul Eggert + + * 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 Paul Eggert diff --git a/lib/fts.c b/lib/fts.c index 152450f8c8..8666cff871 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 * -- 2.30.2