summaryrefslogtreecommitdiff
path: root/lib/fchdir.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-09-24 02:08:13 +0200
committerBruno Haible <bruno@clisp.org>2011-09-24 02:08:13 +0200
commit4810e2dc1d9b1bf84da97d7869f7ad8743b3b3c4 (patch)
treeefbc34f851da79b1c0aae63b25449a6e7e9c8f62 /lib/fchdir.c
parent4040b3bddb086e8230b0d9356297e971729a9c44 (diff)
downloadgnulib-4810e2dc1d9b1bf84da97d7869f7ad8743b3b3c4.tar.gz
New module 'dup'.
* lib/unistd.in.h (dup): Declare only if the 'dup' module is in use. Allow replacement. * lib/dup.c: New file. * lib/fchdir.c (rpl_dup): Remove function. * m4/dup.m4: New file. * m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't set REPLACE_DUP here. * m4/unistd_h.m4 (gl_UNISTD_H): Test whether 'dup' is declared. (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_DUP. * modules/unistd (Makefile.am): Substitute GNULIB_DUP. * modules/dup: New file. * tests/test-unistd-c++.cc: Check the signature of 'dup' only if the 'dup' module is in use. * modules/fdopendir (Depends-on): Add dup. * modules/fdutimensat-tests (Depends-on): Likewise. * modules/fts (Depends-on): Likewise. * modules/futimens-tests (Depends-on): Likewise. * modules/posix_spawnp-tests (Depends-on): Likewise. * modules/unistd-safer-tests (Depends-on): Likewise. * modules/utimens-tests (Depends-on): Likewise. * doc/posix-functions/dup.texi: Mention the new module and the problem on MSVC.
Diffstat (limited to 'lib/fchdir.c')
-rw-r--r--lib/fchdir.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/lib/fchdir.c b/lib/fchdir.c
index e13ba2249d..63c287b207 100644
--- a/lib/fchdir.c
+++ b/lib/fchdir.c
@@ -211,19 +211,6 @@ rpl_fstat (int fd, struct stat *statbuf)
}
#endif
-/* Override dup(), to keep track of open file descriptors. */
-
-int
-rpl_dup (int oldfd)
-#undef dup
-{
- int newfd = dup (oldfd);
-
- if (0 <= newfd)
- newfd = _gl_register_dup (oldfd, newfd);
- return newfd;
-}
-
/* Implement fchdir() in terms of chdir(). */