This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] Ensure that a blocking send() on a socket returns (with success) if a signal is handled mid-transition and SA_RESTART is not set.
- From: "Erik M. Bray" <erik dot m dot bray at gmail dot com>
- To: cygwin-patches at cygwin dot com
- Date: Thu, 11 May 2017 16:05:34 +0200
- Subject: [PATCH] Ensure that a blocking send() on a socket returns (with success) if a signal is handled mid-transition and SA_RESTART is not set.
- Authentication-results: sourceware.org; auth=none
- References: <20170511140534.26860-1-erik.m.bray@gmail.com>
---
winsup/cygwin/fhandler_socket.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index f3d1d69..c7ed681 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -1851,7 +1851,7 @@ fhandler_socket::send_internal (struct _WSAMSG *wsamsg, int flags)
if (get_socket_type () != SOCK_STREAM || ret < out_len)
break;
}
- else if (is_nonblocking () || err != WSAEWOULDBLOCK)
+ else if (is_nonblocking () || WSAGetLastError() != WSAEWOULDBLOCK)
break;
}
--
2.8.3