diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-24 22:49:14 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-24 22:49:14 -0700 |
commit | 936cef69b1e34a2f654de30577cce8bf6db461b5 (patch) | |
tree | d257f8ae9f50a14fe5e5d4a1493f9668d16ada29 /lib/dup2.c | |
parent | 90520caf3cfe735b83237a11034b7aa0c3bb05b9 (diff) | |
download | gnulib-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.c | 4 |
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. */ |