projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests for module 'unistr/u32-cmp2'.
[gnulib.git]
/
lib
/
dup2.c
diff --git
a/lib/dup2.c
b/lib/dup2.c
index
7ce49a2
..
a4422bf
100644
(file)
--- a/
lib/dup2.c
+++ b/
lib/dup2.c
@@
-1,7
+1,6
@@
/* Duplicate an open file descriptor to a specified file descriptor.
/* Duplicate an open file descriptor to a specified file descriptor.
- Copyright (C) 1999, 2004, 2005, 2006, 2007, 2009 Free Software
- Foundation, Inc.
+ Copyright (C) 1999, 2004-2007, 2009-2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-53,6
+52,13
@@
rpl_dup2 (int fd, int desired_fd)
}
return fd;
}
}
return fd;
}
+ /* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
+ http://bugs.winehq.org/show_bug.cgi?id=21289 */
+ if (desired_fd < 0)
+ {
+ errno = EBADF;
+ return -1;
+ }
# endif
result = dup2 (fd, desired_fd);
# ifdef __linux__
# endif
result = dup2 (fd, desired_fd);
# ifdef __linux__