diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-07-05 18:26:23 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-07-05 18:26:23 +0000 |
commit | d5591d9df67a1425a8c05f22cbde430c4a93627f (patch) | |
tree | 96201f8ba2ad69fb41b3dd47a170d65c62f59fd5 /winsup/cygwin/net.cc | |
parent | 89ffbd66e7747dd3719b1252e4037805385c8237 (diff) | |
download | newlib-d5591d9df67a1425a8c05f22cbde430c4a93627f.zip newlib-d5591d9df67a1425a8c05f22cbde430c4a93627f.tar.gz newlib-d5591d9df67a1425a8c05f22cbde430c4a93627f.tar.bz2 |
* fhandler.h (UNCONNECTED): New define.
(CONNECT_PENDING): Ditto.
(CONNECTED): Ditto.
(class fhandler_socket): Add member `had_connect_or_listen'.
Add member functions `is_unconnected', `is_connect_pending' and
`is_connected'.
* fhandler_socket.cc (fhandler_socket::connect): Set member
`had_connect_or_listen' according to return code of WinSock
call.
(fhandler_socket::listen): Ditto.
* net.cc (cygwin_getsockopt): Modify SO_ERROR return value in
case of socket with pending connect().
* select.cc (peek_socket): Only add socket to matching fd_set
if it's not "ready". Call WINSOCK_SELECT only if at least one
socket is in one of the fd_sets.
(start_thread_socket): Only add socket to matching fd_set
if it's not "ready".
(fhandler_socket::select_write): Set write_ready to true also
if socket isn't connected or listening.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r-- | winsup/cygwin/net.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 870bf78..1445ae6 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -712,6 +712,8 @@ cygwin_getsockopt (int fd, int level, int optname, void *optval, int *optlen) if (optname == SO_ERROR) { int *e = (int *) optval; + if (!*e && fh->is_connect_pending ()) + *e = WSAEINPROGRESS; *e = find_winsock_errno (*e); } |