summaryrefslogtreecommitdiff
path: root/lib/dup2.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-09-24 22:49:14 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-09-24 22:49:14 -0700
commit936cef69b1e34a2f654de30577cce8bf6db461b5 (patch)
treed257f8ae9f50a14fe5e5d4a1493f9668d16ada29 /lib/dup2.c
parent90520caf3cfe735b83237a11034b7aa0c3bb05b9 (diff)
downloadgnulib-936cef69b1e34a2f654de30577cce8bf6db461b5.tar.gz
dup2: minor simplifications
* lib/dup2.c (ms_windows_dup2): Omit 'inline' as it's not clear that it's a performance win. (rpl_dup2): Change "if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)" to "ifdef F_GETFL".
Diffstat (limited to 'lib/dup2.c')
-rw-r--r--lib/dup2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dup2.c b/lib/dup2.c
index 278261fcd2..790c98a2e8 100644
--- a/lib/dup2.c
+++ b/lib/dup2.c
@@ -40,7 +40,7 @@
/* Get _get_osfhandle. */
# include "msvc-nothrow.h"
-static inline int
+static int
ms_windows_dup2 (int fd, int desired_fd)
{
int result;
@@ -92,7 +92,7 @@ rpl_dup2 (int fd, int desired_fd)
{
int result;
-# if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# ifdef F_GETFL
/* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF.
On Cygwin 1.5.x, dup2 (1, 1) returns 0.
On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */