diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-04-01 14:36:40 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-04-01 14:36:40 +0400 |
commit | 4cfacffa795c41e117a02c21741a0868168f3a10 (patch) | |
tree | 8a608c829f1a0286dc209bbefec18bd245a33f40 | |
parent | 4fc406c935d3896553e5f925e271428f92996d3c (diff) |
* net.cc (wsock_event::wait): Make wsa_err an int. Don't set
ret to 0 if any error has happened.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/net.cc | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e60be8d38..819b9b21c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 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 has_been_closed gets set. (fhandler_socket::sendmsg): Ditto. diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 2459580b5..4f8ee3d12 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -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); |