Commit 0d9fce2a authored by Eric Blake's avatar Eric Blake
Browse files

dup2, pipe2: fix some recent test failures on cygwin 1.5.x



* lib/pipe2.c (includes): Add binary-io.h.
* lib/dup2.c (rpl_dup2): Correct buggy errno value.
Signed-off-by: default avatarEric Blake <ebb9@byu.net>
parent 27d2db55
2009-08-24 Eric Blake <ebb9@byu.net>
dup2, pipe2: fix some recent test failures on cygwin 1.5.x
* lib/pipe2.c (includes): Add binary-io.h.
* lib/dup2.c (rpl_dup2): Correct buggy errno value.
2009-08-24 Bruno Haible <bruno@clisp.org>
 
Tolerate declared but missing accept4 syscall.
......@@ -57,6 +57,9 @@ rpl_dup2 (int fd, int desired_fd)
result = dup2 (fd, desired_fd);
if (result == 0)
result = desired_fd;
/* Correct a cygwin 1.5.x errno value. */
else if (result == -1 && errno == EMFILE)
errno = EBADF;
return result;
}
......
......@@ -23,6 +23,8 @@
#include <errno.h>
#include <fcntl.h>
#include "binary-io.h"
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Native Woe32 API. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment