* autoload.cc: Add autoload statement for `WSASetLastError'.

* net.cc (cygwin_connect): Change error code to WSAEINPROGRESS
        when connect returns WSAEWOULDBLOCK.
This commit is contained in:
Corinna Vinschen
2000-11-07 20:01:09 +00:00
parent 64ef9db779
commit 4c25744f86
3 changed files with 15 additions and 1 deletions

View File

@ -600,7 +600,14 @@ cygwin_connect (int fd,
{
res = connect (sock->get_socket (), (sockaddr *) &sin, namelen);
if (res)
set_winsock_errno ();
{
/* Special handling for connect to return the correct error code
when called to early on a non-blocking socket. */
if (WSAGetLastError () == WSAEWOULDBLOCK)
WSASetLastError (WSAEINPROGRESS);
set_winsock_errno ();
}
}
return res;
}