From ceb26704b6d3047bfd7c109a471c9d6c7c812904 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 9 Jul 2013 10:00:58 -0700 Subject: [PATCH] accept4, dup3, pipe2: port to Cygwin Problem reported for Emacs by Ken Brown in . * 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 | 12 ++++++++++++ lib/accept4.c | 4 ++-- lib/dup3.c | 4 ++-- lib/pipe2.c | 13 +++++-------- modules/binary-io | 1 - 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39fd40bf4..484484af9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2013-07-09 Paul Eggert + + accept4, dup3, pipe2: port to Cygwin + Problem reported for Emacs by Ken Brown in . + * 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 mountlist: add support for deallocating returned list entries diff --git a/lib/accept4.c b/lib/accept4.c index 4dcb5424a..906f2517d 100644 --- a/lib/accept4.c +++ b/lib/accept4.c @@ -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; diff --git a/lib/dup3.c b/lib/dup3.c index 99851d113..b2b57056c 100644 --- a/lib/dup3.c +++ b/lib/dup3.c @@ -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; diff --git a/lib/pipe2.c b/lib/pipe2.c index 956907322..aca18e3b9 100644 --- a/lib/pipe2.c +++ b/lib/pipe2.c @@ -22,10 +22,7 @@ #include #include -#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 diff --git a/modules/binary-io b/modules/binary-io index 1f646dc4d..486025245 100644 --- a/modules/binary-io +++ b/modules/binary-io @@ -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 -- 2.11.0