summaryrefslogtreecommitdiff
path: root/lib/dup3.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-09-01 09:18:16 -0600
committerEric Blake <ebb9@byu.net>2009-09-02 19:14:45 -0600
commitdd66a62cc2d76ab463e1167824ea4ca5fd4ef2ae (patch)
tree7926e1b2496c9bee62d53ca388b4544bcdd275c0 /lib/dup3.c
parent4475e25b6a19e31e5783781f2132cdbd05bcf7c4 (diff)
downloadgnulib-dd66a62cc2d76ab463e1167824ea4ca5fd4ef2ae.tar.gz
fchdir: use more consistent macro convention
* lib/fcntl.in.h (_gl_register_fd): Move declaration to unistd. * lib/sys_stat.in.h (rpl_fstat): Declare via make-time REPLACE_FCHDIR, rather than relying on config.h macros. * lib/unistd.in.h (fchdir): Move all fchdir internal declarations inside a single make-time REPLACE_FCHDIR block, rather than using the config.h FCHDIR_REPLACEMENT. * m4/fchdir.m4 (gl_FUNC_FCHDIR): REPLACE_FCHDIR was already AC_SUBST'd, also AC_DEFINE it. Don't define FCHDIR_REPLACEMENT. Manage fstat replacement. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Pick up REPLACE_FCHDIR. * modules/sys_stat (Files): Add m4/unistd_h.m4. (Makefile.am): Substitute REPLACE_FCHDIR. * lib/close.c (rpl_close): Use REPLACE_FCHDIR, not FCHDIR_REPLACEMENT. * lib/dup-safer.c (dup_safer): Likewise. * lib/dup2.c (rpl_dup2): Likewise. * lib/dup3.c (rpl_dup3): Likewise. * lib/open.c (rpl_open): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'lib/dup3.c')
-rw-r--r--lib/dup3.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/dup3.c b/lib/dup3.c
index 3d6f940cd4..879a9074f2 100644
--- a/lib/dup3.c
+++ b/lib/dup3.c
@@ -63,7 +63,7 @@ dup3 (int oldfd, int newfd, int flags)
if (!(result < 0 && errno == ENOSYS))
{
have_dup3_really = 1;
-#ifdef FCHDIR_REPLACEMENT
+#if REPLACE_FCHDIR
if (0 <= result)
result = _gl_register_dup (oldfd, newfd);
#endif
@@ -184,7 +184,7 @@ dup3 (int oldfd, int newfd, int flags)
errno = saved_errno;
}
-#ifdef FCHDIR_REPLACEMENT
+#if REPLACE_FCHDIR
if (result == newfd)
result = _gl_register_dup (oldfd, newfd);
#endif
@@ -226,7 +226,7 @@ dup3 (int oldfd, int newfd, int flags)
setmode (newfd, O_TEXT);
#endif
-#ifdef FCHDIR_REPLACEMENT
+#if REPLACE_FCHDIR
newfd = _gl_register_dup (oldfd, newfd);
#endif
return newfd;