From bf6fc6c1a5e5643f3262f2d52bab68b9d56db36f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 5 Dec 2002 10:45:13 +0000 Subject: Update. 2002-12-05 Ulrich Drepper * dirent/bug-readdir1.c (main): Don't call closedir, just close on the file descriptor. This is testing what the bug report was about. --- ChangeLog | 5 +++++ dirent/bug-readdir1.c | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4921fa5d37..e2566bfb19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-12-05 Ulrich Drepper + + * dirent/bug-readdir1.c (main): Don't call closedir, just close on + the file descriptor. This is testing what the bug report was about. + 2002-12-04 Ulrich Drepper * po/be.po: New file. diff --git a/dirent/bug-readdir1.c b/dirent/bug-readdir1.c index f9c609cc98..1f70722dd2 100644 --- a/dirent/bug-readdir1.c +++ b/dirent/bug-readdir1.c @@ -23,11 +23,12 @@ main (void) exit (1); } - /* close the dir stream, making it invalid */ - if (closedir (dirp)) + /* close the directory file descriptor, making it invalid */ + if (close (dirfd (dirp)) != 0) { - perror ("closedir"); - exit (1); + puts ("could not close directory file descriptor"); + /* This is not an error. It is not guaranteed this is possible. */ + return 0; } ent = readdir (dirp); -- cgit v1.2.3