mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
* fhandler_socket.cc (fhandler_socket::close): Respond to signals while
looping, waiting for socket to close. Superstitiously clear last error when WSAEWOULDBLOCK.
This commit is contained in:
parent
241a7c5a8c
commit
eeac69d835
@ -1,3 +1,9 @@
|
||||
2002-03-05 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* fhandler_socket.cc (fhandler_socket::close): Respond to signals while
|
||||
looping, waiting for socket to close. Superstitiously clear last error
|
||||
when WSAEWOULDBLOCK.
|
||||
|
||||
2002-03-05 Robert Collins <rbtcollins@hotmail.com>
|
||||
|
||||
* cygserver_transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
|
||||
|
@ -352,13 +352,21 @@ fhandler_socket::close ()
|
||||
setsockopt (get_socket (), SOL_SOCKET, SO_LINGER,
|
||||
(const char *)&linger, sizeof linger);
|
||||
|
||||
while ((res = closesocket (get_socket ()))
|
||||
&& WSAGetLastError () == WSAEWOULDBLOCK)
|
||||
continue;
|
||||
if (res)
|
||||
while ((res = closesocket (get_socket ())) != 0)
|
||||
{
|
||||
set_winsock_errno ();
|
||||
res = -1;
|
||||
if (WSAGetLastError () != WSAEWOULDBLOCK)
|
||||
{
|
||||
set_winsock_errno ();
|
||||
res = -1;
|
||||
break;
|
||||
}
|
||||
if (WaitForSingleObject (signal_arrived, 10) == WAIT_OBJECT_0)
|
||||
{
|
||||
set_errno (EINTR);
|
||||
res = -1;
|
||||
break;
|
||||
}
|
||||
WSASetLastError (0);
|
||||
}
|
||||
|
||||
close_secret_event ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user