[PATCH] Fix bug with blocking send interrupted by a signal
Erik M. Bray
erik.m.bray@gmail.com
Thu May 11 14:05:00 GMT 2017
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
More information about the Cygwin-patches
mailing list