diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-12-05 10:45:13 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-12-05 10:45:13 +0000 |
commit | bf6fc6c1a5e5643f3262f2d52bab68b9d56db36f (patch) | |
tree | 56b59b2e04bacf4e32b54ff3a73eec7d0530e424 /dirent/bug-readdir1.c | |
parent | d8d317454d27b89a864a860d67c4fbecc868a652 (diff) | |
download | glibc-bf6fc6c1a5e5643f3262f2d52bab68b9d56db36f.zip glibc-bf6fc6c1a5e5643f3262f2d52bab68b9d56db36f.tar.gz glibc-bf6fc6c1a5e5643f3262f2d52bab68b9d56db36f.tar.bz2 |
Update.
2002-12-05 Ulrich Drepper <drepper@redhat.com>
* dirent/bug-readdir1.c (main): Don't call closedir, just close on
the file descriptor. This is testing what the bug report was about.
Diffstat (limited to 'dirent/bug-readdir1.c')
-rw-r--r-- | dirent/bug-readdir1.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dirent/bug-readdir1.c b/dirent/bug-readdir1.c index f9c609c..1f70722 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); |