summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-06-25 01:40:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-06-25 01:40:38 -0700
commit7a7ef429182915745380c3074771d9f747dab964 (patch)
treed3bff619b8eef19d5f508473926f495dee4f1737 /src
parentcd3520a41df21d80a9d894c58af2daba23c8dd24 (diff)
downloademacs-7a7ef429182915745380c3074771d9f747dab964.tar.gz
Use gnulib's dup2 module instead of rolling our own.
* Makefile.in (GNULIB_MODULES): Add dup2. * configure.in: Do not check for dup2; gnulib does that now. * lib/dup2.c, m4/dup2.m4: New files, from gnulib. * src/sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/sysdep.c31
2 files changed, 5 insertions, 31 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b8b3d2a1a9c..792208f7c29 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use gnulib's dup2 module instead of rolling our own.
+ * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
+
2011-06-24 Juanma Barranquero <lekktu@gmail.com>
Move DEFSYM to lisp.h and use everywhere.
diff --git a/src/sysdep.c b/src/sysdep.c
index 5ad3389dd8f..3a73b1a467b 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2012,37 +2012,6 @@ perror (void)
}
#endif /* HPUX and not HAVE_PERROR */
-#ifndef HAVE_DUP2
-
-/*
- * Emulate BSD dup2. First close newd if it already exists.
- * Then, attempt to dup oldd. If not successful, call dup2 recursively
- * until we are, then close the unsuccessful ones.
- */
-
-int
-dup2 (int oldd, int newd)
-{
- register int fd, ret;
-
- emacs_close (newd);
-
-#ifdef F_DUPFD
- return fcntl (oldd, F_DUPFD, newd);
-#else
- fd = dup (old);
- if (fd == -1)
- return -1;
- if (fd == new)
- return new;
- ret = dup2 (old,new);
- emacs_close (fd);
- return ret;
-#endif
-}
-
-#endif /* not HAVE_DUP2 */
-
/*
* Gettimeofday. Simulate as much as possible. Only accurate
* to nearest second. Emacs doesn't use tzp so ignore it for now.