summaryrefslogtreecommitdiff
path: root/gl/unistd.in.h
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-08-06 16:30:15 +0200
committerSimon Josefsson <simon@josefsson.org>2009-08-06 16:30:15 +0200
commit92a5cd11f9b33f427c495dca22d9aac1cf7b1f3d (patch)
treeb3bb68a392114cd82b5f174061b0d6ab77cfa1f2 /gl/unistd.in.h
parenta532faf3bd6d95bf41ba75733a72b504090667af (diff)
downloadgnutls-92a5cd11f9b33f427c495dca22d9aac1cf7b1f3d.tar.gz
Update gnulib files.
Diffstat (limited to 'gl/unistd.in.h')
-rw-r--r--gl/unistd.in.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index fa8d84a3d9..09e90392df 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -150,10 +150,13 @@ extern int close (int);
#if @GNULIB_DUP2@
-# if !@HAVE_DUP2@
+# if @REPLACE_DUP2@
+# define dup2 rpl_dup2
+# endif
+# if !@HAVE_DUP2@ || @REPLACE_DUP2@
/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
NEWFD = OLDFD, otherwise close NEWFD first if it is open.
- Return 0 if successful, otherwise -1 and errno set.
+ Return newfd if successful, otherwise -1 and errno set.
See the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/dup2.html>. */
extern int dup2 (int oldfd, int newfd);
@@ -214,7 +217,11 @@ extern int fchdir (int /*fd*/);
# define dup rpl_dup
extern int dup (int);
-# define dup2 rpl_dup2
+
+# if @REPLACE_DUP2@
+# undef dup2
+# endif
+# define dup2 rpl_dup2_fchdir
extern int dup2 (int, int);
# endif