This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix bug with blocking send interrupted by a signal


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]