aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-09-05 08:16:51 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-09-05 08:16:51 +0000
commit47497e62435513c9a32f8c511118a58357db63ed (patch)
treec88af64dab0248b3c8cad581cfec5ab732a0c793 /winsup
parent0bcb0f6a0e6c9981a9ea7be32ba898dbd563cf53 (diff)
downloadnewlib-47497e62435513c9a32f8c511118a58357db63ed.zip
newlib-47497e62435513c9a32f8c511118a58357db63ed.tar.gz
newlib-47497e62435513c9a32f8c511118a58357db63ed.tar.bz2
* net.cc (cygwin_connect): Add WSAEALREADY and WSAEINVAL handling
for non-blocking sockets.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/net.cc15
2 files changed, 15 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 1d60b7f..4728bc1 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 7077220..1715b16 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -868,13 +868,18 @@ cygwin_connect (int fd,
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)