+Wed Sep 5 10:14:00 2001 Corinna Vinschen <corinna@vinschen.de>
+
+ * net.cc (cygwin_connect): Add WSAEALREADY and WSAEINVAL handling
+ for non-blocking sockets.
+
Tue Sep 4 22:42:13 2001 Christopher Faylor <cgf@cygnus.com>
* exceptions.cc (ctrl_c_handler): Only send SIGINT when we have a
if (res)
{
/* Special handling for connect to return the correct error code
- when called to early on a non-blocking socket. */
- if (WSAGetLastError () == WSAEWOULDBLOCK)
+ when called on a non-blocking socket. */
+ if (sock->is_nonblocking ())
{
- WSASetLastError (WSAEINPROGRESS);
- in_progress = TRUE;
+ DWORD err = WSAGetLastError ();
+ if (err == WSAEWOULDBLOCK || err == WSAEALREADY)
+ {
+ WSASetLastError (WSAEINPROGRESS);
+ in_progress = TRUE;
+ }
+ else if (err == WSAEINVAL)
+ WSASetLastError (WSAEISCONN);
}
-
set_winsock_errno ();
}
if (sock->get_addr_family () == AF_UNIX)