summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_socket.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index c2e87478d..e7194dfe5 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -698,7 +698,9 @@ fhandler_socket::connect (const struct sockaddr *name, int namelen)
res = ::connect (get_socket (), (sockaddr *) &sin, namelen);
- if (res)
+ if (!res)
+ err = 0;
+ else
{
err = WSAGetLastError ();
/* Special handling for connect to return the correct error code