fdopendir: fix GNU/Hurd bug
authorEric Blake <ebb9@byu.net>
Tue, 6 Oct 2009 12:58:08 +0000 (06:58 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 7 Oct 2009 04:06:49 +0000 (22:06 -0600)
commitdfbec8be94ca116ce40c04f88302329505dbb745
treee25ce6c31551b711f784d927aa215860370c4d04
parent48b0feac54dce2caf46cc53dd160e699737ff52a
fdopendir: fix GNU/Hurd bug

fdopendir(open("file",O_RDONLY)) mistakenly succeeded, with
subsequent readdir() failing with ENOTDIR.

* m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): Check for Hurd bug in
allowing non-directory fds.
* lib/fdopendir.c (rpl_fdopendir): Work around it.
* m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): New witness.
* modules/dirent (Makefile.am): Substitute it.
* lib/dirent.in.h (fdopendir): Declare replacement.
* doc/posix-functions/fdopendir.texi (fdopendir): Document this.
* tests/test-fdopendir.c (main): Test something other than
/dev/null, since on Hurd that behaves like a directory.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/posix-functions/fdopendir.texi
lib/dirent.in.h
lib/fdopendir.c
m4/dirent_h.m4
m4/fdopendir.m4
modules/dirent
tests/test-fdopendir.c