accept4, dup3, pipe2: port to Cygwin
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 9 Jul 2013 17:00:58 +0000 (10:00 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 9 Jul 2013 17:02:10 +0000 (10:02 -0700)
Problem reported for Emacs by Ken Brown in <http://bugs.gnu.org/14821>.
* lib/accept4.c (accept4) [O_BINARY]:
* lib/dup3.c (dup3) [O_BINARY]:
* lib/pipe2.c (pipe2) [O_BINARY]:
Use set_binary_mode, not setmode.
* lib/pipe2.c [!GNULIB_BINARY_IO]: Include binary-io.h.
* modules/binary-io (Depends-on): Remove module indicator.
These last two bits undo the previous change to pipe2 and binary-io.

ChangeLog
lib/accept4.c
lib/dup3.c
lib/pipe2.c
modules/binary-io

index 39fd40b..484484a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-07-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       accept4, dup3, pipe2: port to Cygwin
+       Problem reported for Emacs by Ken Brown in <http://bugs.gnu.org/14821>.
+       * lib/accept4.c (accept4) [O_BINARY]:
+       * lib/dup3.c (dup3) [O_BINARY]:
+       * lib/pipe2.c (pipe2) [O_BINARY]:
+       Use set_binary_mode, not setmode.
+       * lib/pipe2.c [!GNULIB_BINARY_IO]: Include binary-io.h.
+       * modules/binary-io (Depends-on): Remove module indicator.
+       These last two bits undo the previous change to pipe2 and binary-io.
+
 2013-07-09  Pádraig Brady  <P@draigBrady.com>
 
        mountlist: add support for deallocating returned list entries
index 4dcb542..906f251 100644 (file)
@@ -119,9 +119,9 @@ accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags)
 
 #if O_BINARY
   if (flags & O_BINARY)
-    setmode (fd, O_BINARY);
+    set_binary_mode (fd, O_BINARY);
   else if (flags & O_TEXT)
-    setmode (fd, O_TEXT);
+    set_binary_mode (fd, O_TEXT);
 #endif
 
   return fd;
index 99851d1..b2b5705 100644 (file)
@@ -92,9 +92,9 @@ dup3 (int oldfd, int newfd, int flags)
 
 #if O_BINARY
   if (flags & O_BINARY)
-    setmode (newfd, O_BINARY);
+    set_binary_mode (newfd, O_BINARY);
   else if (flags & O_TEXT)
-    setmode (newfd, O_TEXT);
+    set_binary_mode (newfd, O_TEXT);
 #endif
 
   return newfd;
index 9569073..aca18e3 100644 (file)
 #include <errno.h>
 #include <fcntl.h>
 
-#if GNULIB_BINARY_IO
-# include "binary-io.h"
-#endif
-
+#include "binary-io.h"
 #include "verify.h"
 
 #if GNULIB_defined_O_NONBLOCK
@@ -141,13 +138,13 @@ pipe2 (int fd[2], int flags)
 # if O_BINARY
   if (flags & O_BINARY)
     {
-      setmode (fd[1], O_BINARY);
-      setmode (fd[0], O_BINARY);
+      set_binary_mode (fd[1], O_BINARY);
+      set_binary_mode (fd[0], O_BINARY);
     }
   else if (flags & O_TEXT)
     {
-      setmode (fd[1], O_TEXT);
-      setmode (fd[0], O_TEXT);
+      set_binary_mode (fd[1], O_TEXT);
+      set_binary_mode (fd[0], O_TEXT);
     }
 # endif
 
index 1f646dc..4860252 100644 (file)
@@ -10,7 +10,6 @@ extern-inline
 fcntl-h
 
 configure.ac:
-gl_MODULE_INDICATOR([binary-io])
 
 Makefile.am:
 lib_SOURCES += binary-io.h binary-io.c