This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] Fix bug with blocking send interrupted by a signal
- 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:33 +0200
- Subject: [PATCH] Fix bug with blocking send interrupted by a signal
- Authentication-results: sourceware.org; auth=none
The following patch fixes an issue I found via the Python test suite--when a
large send() on a socket has to be chunked, if part of the data has already
been transmitted, a signal will not cause the send() to be interrupted even
if SA_RESTART is not set.
For the sake of consistency with Linux's behavior (which recv() already has)
send() should return successfully in this case. On the other hand, if
SA_RESTART is set, send() will continue to block with this patch. The only
issue here was that while fhandler_socket::wait_for_events can set a socket
error (particularly WSAEINTR) when an interrupted has been handled, that error
was not being checked.
Erik M. Bray (1):
Ensure that a blocking send() on a socket returns (with success) if a
signal is handled mid-transition and SA_RESTART is not set.
winsup/cygwin/fhandler_socket.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.8.3