+Tue Nov 7 20:58:00 2000 Corinna Vinschen <corinna@vinschen.de>
+
+ * autoload.cc: Add autoload statement for `WSASetLastError'.
+ * net.cc (cygwin_connect): Change error code to WSAEINPROGRESS
+ when connect returns WSAEWOULDBLOCK.
+
Mon Nov 6 15:11:57 2000 Christopher Faylor <cgf@cygnus.com>
* dcrt0.cc (sigthread::init): Reinstitute sigthread lock as a critical
LoadDLLfunc (WSAAsyncSelect, 16, wsock32)
LoadDLLfunc (WSACleanup, 0, wsock32)
LoadDLLfunc (WSAGetLastError, 0, wsock32)
+LoadDLLfunc (WSASetLastError, 4, wsock32)
LoadDLLfunc (WSAStartup, 8, wsock32)
LoadDLLfunc (__WSAFDIsSet, 8, wsock32)
LoadDLLfunc (accept, 12, wsock32)
{
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;
}