mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 04:49:25 +08:00
* net.cc (wsock_event::wait): Make wsa_err an int. Don't set
ret to 0 if any error has happened.
This commit is contained in:
parent
4fc406c935
commit
4cfacffa79
@ -1,3 +1,8 @@
|
||||
2004-04-01 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* net.cc (wsock_event::wait): Make wsa_err an int. Don't set
|
||||
ret to 0 if any error has happened.
|
||||
|
||||
2004-04-01 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhandler_socket.cc (fhandler_socket::sendto): Drop out of loop if
|
||||
|
@ -69,7 +69,7 @@ int
|
||||
wsock_event::wait (int sock, int &closed)
|
||||
{
|
||||
int ret = SOCKET_ERROR;
|
||||
DWORD wsa_err = 0;
|
||||
int wsa_err = 0;
|
||||
WSAEVENT ev[2] = { event, signal_arrived };
|
||||
switch (WSAWaitForMultipleEvents (2, ev, FALSE, WSA_INFINITE, FALSE))
|
||||
{
|
||||
@ -94,10 +94,13 @@ wsock_event::wait (int sock, int &closed)
|
||||
if (evts.lNetworkEvents & FD_CLOSE)
|
||||
{
|
||||
closed = 1;
|
||||
if (!wsa_err && evts.iErrorCode[FD_CLOSE_BIT])
|
||||
wsa_err = evts.iErrorCode[FD_CLOSE_BIT];
|
||||
else
|
||||
ret = 0;
|
||||
if (!wsa_err)
|
||||
{
|
||||
if (evts.iErrorCode[FD_CLOSE_BIT])
|
||||
wsa_err = evts.iErrorCode[FD_CLOSE_BIT];
|
||||
else
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
if (wsa_err)
|
||||
WSASetLastError (wsa_err);
|
||||
|
Loading…
x
Reference in New Issue
Block a user