Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 72669c53f..30c7237ad 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)