fchdir: port to mingw
authorEric Blake <ebb9@byu.net>
Mon, 31 Aug 2009 12:09:08 +0000 (06:09 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 1 Sep 2009 01:19:55 +0000 (19:19 -0600)
commit8fc864a0b873beea0c37acb7898a8cf5f497fb4e
tree0ba2c73d5558da6f3f36db24e1c43b90ac254e9e
parenta01c968e6d045385bb27857eacc9100c4bb829a9
fchdir: port to mingw

* m4/fchdir.m4 (gl_FUNC_FCHDIR): Check for mingw bug.
* lib/open.c (open) [FCHDIR_REPLACEMENT]: If directories can't be
opened, then use a substitute.
* lib/sys_stat.in.h (fstat) [REPLACE_OPEN_DIRECTORY]: Declare
replacement.
* lib/fchdir.c (fstat) [REPLACE_OPEN_DIRECTORY]: Implement it.
(_gl_register_fd): No need to check stat if open already filters
all directories.
(fchdir): Fix error condition to match POSIX.
* modules/fchdir (Depends-on): Add sys_stat.
* doc/posix-functions/open.texi (open): Document the limitation.
* modules/fchdir-tests: New file.
* tests/test-fchdir.c: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/posix-functions/open.texi
lib/fchdir.c
lib/open.c
lib/sys_stat.in.h
m4/fchdir.m4
modules/fchdir
modules/fchdir-tests [new file with mode: 0644]
tests/test-fchdir.c [new file with mode: 0644]