* lib/pipe2.c (includes): Add binary-io.h.
* lib/dup2.c (rpl_dup2): Correct buggy errno value.
Signed-off-by: Eric Blake <ebb9@byu.net>
+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.
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;
}
#include <errno.h>
#include <fcntl.h>
+#include "binary-io.h"
+
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Native Woe32 API. */