aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/autoload.cc1
-rw-r--r--winsup/cygwin/net.cc9
3 files changed, 15 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d55b6ee..ac02b40 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 6f9344a..e82aa5a 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -275,6 +275,7 @@ LoadDLLinit (wsock32)
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)
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 9f0816b..31c4029 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -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;
}