diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-10-11 10:50:36 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-10-11 10:50:36 +0000 |
commit | 9f64fd80819b80513fadfe842622cf6d3853c1c0 (patch) | |
tree | e3b1bf229efe33462ad12be828e2dc6ab985a046 | |
parent | 3ab591cf71a5302ead4eaa1eeff9242717cfdcad (diff) | |
download | newlib-9f64fd80819b80513fadfe842622cf6d3853c1c0.zip newlib-9f64fd80819b80513fadfe842622cf6d3853c1c0.tar.gz newlib-9f64fd80819b80513fadfe842622cf6d3853c1c0.tar.bz2 |
* fhandler_socket.cc (fhandler_socket::evaluate_events): Slightly
rearrange code. Rephrase a comment.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_socket.cc | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ed36c5d..4c558dd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2014-10-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::evaluate_events): Slightly + rearrange code. Rephrase a comment. + 2014-10-10 Corinna Vinschen <corinna@vinschen.de> * dlfcn.cc (dlopen): Disable old 32 bit code on 64 bit. diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 0354ee2..93cfddf 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -634,15 +634,15 @@ fhandler_socket::evaluate_events (const long event_mask, long &events, { if (events & FD_CONNECT) { - int wsa_err = 0; - if ((wsa_err = wsock_events->connect_errorcode) != 0) + int wsa_err = wsock_events->connect_errorcode; + if (wsa_err) { /* CV 2014-04-23: This is really weird. If you call connect asynchronously on a socket and then select, an error like "Connection refused" is set in the event and in the SO_ERROR socket option. If you call connect, then dup, then select, the error is set in the event, but not in the SO_ERROR socket - option, even if the dup'ed socket handle refers to the same + option, despite the dup'ed socket handle referring to the same socket. We're trying to workaround this problem here by taking the connect errorcode from the event and write it back into the SO_ERROR socket option. |