diff options
author | Eric Blake <ebb9@byu.net> | 2009-09-15 15:54:43 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-09-15 21:46:51 -0600 |
commit | c9dd0005fe00602d13c3d54f0834655b1e769520 (patch) | |
tree | 8a2e62f0a6a98abd4180814b4596f1ac72f24025 /m4/fchdir.m4 | |
parent | b362649a288ba02eb66811ce42b2ed02eb0f672a (diff) | |
download | gnulib-c9dd0005fe00602d13c3d54f0834655b1e769520.tar.gz |
fchdir: improve use of replacement functions
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Set appropriate witnesses.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add REPLACE_FSTAT.
* m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): Add REPLACE_OPENDIR,
REPLACE_CLOSEDIR.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add REPLACE_DUP.
* modules/sys_stat (Makefile.am): Substitute correct witness.
* modules/dirent (Makefile.am): Likewise.
* modules/unistd (Makefile.am): Likewise.
* lib/dirent.in.h (opendir, closedir): Use better witnesses.
* lib/unistd.in.h (dup): Likewise.
* lib/sys_stat.in.h (fstat): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'm4/fchdir.m4')
-rw-r--r-- | m4/fchdir.m4 | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/m4/fchdir.m4 b/m4/fchdir.m4 index 6597be06c8..f0e4dc00d8 100644 --- a/m4/fchdir.m4 +++ b/m4/fchdir.m4 @@ -1,4 +1,4 @@ -# fchdir.m4 serial 9 +# fchdir.m4 serial 10 dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -16,7 +16,13 @@ AC_DEFUN([gl_FUNC_FCHDIR], gl_PREREQ_FCHDIR AC_DEFINE([REPLACE_FCHDIR], [1], [Define to 1 if gnulib's fchdir() replacement is used.]) + dnl We must also replace anything that can manipulate a directory fd, + dnl to keep our bookkeeping up-to-date. We don't have to replace + dnl fstatat, since no platform has fstatat but lacks fchdir. REPLACE_FSTAT=1 + REPLACE_OPENDIR=1 + REPLACE_CLOSEDIR=1 + REPLACE_DUP=1 gl_REPLACE_OPEN gl_REPLACE_CLOSE gl_REPLACE_DUP2 |