Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2002-07-06 15:16:07 +0400
committerCorinna Vinschen <corinna@vinschen.de>2002-07-06 15:16:07 +0400
commit6bb769efa0a993613e311a586362dbd780a41ca5 (patch)
tree7a66c185a404be0d432c8836cc3e8a79761a2bf5 /winsup/cygwin/fhandler_socket.cc
parent6201dd26a65c2db4cb8f1e902c0dffcde4dfdaef (diff)
* fhandler.h (fhandler_socket::is_unconnected): Constify.
(fhandler_socket::is_connect_pending): Ditto. (fhandler_socket::is_connected): Ditto. (fhandler_socket::set_connect_state): New method. (struct select_record): Add member `except_on_write'. (select_record::select_record): Initialize all bool values to `false'. * fhandler_socket.cc: Use set_connect_state() method throughout. (fhandler_socket::connect): Set state always to connected if connection isn't pending. * net.cc (cygwin_getsockopt): Revert erroneous previous patch. * select.cc (set_bits): Check for `except_on_write'. Set fd in write_fds if set. Set connect state to connected if fd has been returned by WINSOCK_SELECT. (peek_socket): Check for `except_on_write'. (start_thread_socket): Ditto. (fhandler_socket::select_write): Don't set `write_ready' if connect is pending. Set `except_on_write' if connect is pending.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index e95655510..aed61d780 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -455,10 +455,10 @@ fhandler_socket::connect (const struct sockaddr *name, int namelen)
}
}
- if (!res)
- had_connect_or_listen = CONNECTED;
- else if (WSAGetLastError () == WSAEINPROGRESS)
- had_connect_or_listen = CONNECT_PENDING;
+ if (WSAGetLastError () == WSAEINPROGRESS)
+ set_connect_state (CONNECT_PENDING);
+ else
+ set_connect_state (CONNECTED);
return res;
}
@@ -469,7 +469,7 @@ fhandler_socket::listen (int backlog)
if (res)
set_winsock_errno ();
else
- had_connect_or_listen = CONNECTED;
+ set_connect_state (CONNECTED);
return res;
}