diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-08-23 13:07:24 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-08-23 13:07:24 +0000 |
commit | 247caa48ea1f6f16622ad384fcaefb488de04c56 (patch) | |
tree | 0d35bf89cd0b31468b151607b369d008a2e6755e | |
parent | 1c5c40f638cf66cced5ed614a3e937a3d6be79f8 (diff) | |
download | newlib-247caa48ea1f6f16622ad384fcaefb488de04c56.zip newlib-247caa48ea1f6f16622ad384fcaefb488de04c56.tar.gz newlib-247caa48ea1f6f16622ad384fcaefb488de04c56.tar.bz2 |
* fhandler_socket.cc (fhandler_socket::send_internal): Fix setting
nosignal flag. Convert ECONNABORTED on connection-oriented socket
to EPIPE, too.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_socket.cc | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 73e6dd4..d959184 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2011-08-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::send_internal): Fix setting + nosignal flag. Convert ECONNABORTED on connection-oriented socket + to EPIPE, too. + 2011-08-21 Christopher Faylor <me.cygwin2011@cgf.cx> * dtable.cc (conv_start_chars): Remove unneeded section attribute. diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 72669c5..30c7237 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -1585,7 +1585,7 @@ fhandler_socket::send_internal (struct _WSAMSG *wsamsg, int flags) WSABUF buf; bool use_sendmsg = false; DWORD wait_flags = flags & MSG_DONTWAIT; - bool nosignal = !(flags & MSG_NOSIGNAL); + bool nosignal = !!(flags & MSG_NOSIGNAL); flags &= (MSG_OOB | MSG_DONTROUTE); if (wsamsg->Control.len > 0) @@ -1648,7 +1648,8 @@ fhandler_socket::send_internal (struct _WSAMSG *wsamsg, int flags) EPIPE is generated if the local end has been shut down on a connection oriented socket. In this case the process will also receive a SIGPIPE unless MSG_NOSIGNAL is set. */ - if (get_errno () == ESHUTDOWN && get_socket_type () == SOCK_STREAM) + if ((get_errno () == ECONNABORTED || get_errno () == ESHUTDOWN) + && get_socket_type () == SOCK_STREAM) { set_errno (EPIPE); if (!nosignal) |