]> granicus.if.org Git - python/commitdiff
The other half of the patches added to SF patch 555085 by A I
authorGuido van Rossum <guido@python.org>
Thu, 8 Aug 2002 20:39:30 +0000 (20:39 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 8 Aug 2002 20:39:30 +0000 (20:39 +0000)
MacIntyre.  At least on OS/2, a subsequent connect() on a nonblocking
socket returns errno==EISCONN to indicate success.  This seems
harmless on Unix.

Modules/socketmodule.c

index 29b6339fe747a6f77d018da3203f06b9d38edee1..616c8362ee12ed1f9c5113284cf0aad12c0641c5 100644 (file)
@@ -1327,6 +1327,8 @@ internal_connect(PySocketSockObject *s, struct sockaddr *addr, int addrlen)
                if (res < 0 && errno == EINPROGRESS) {
                        internal_select(s, 1);
                        res = connect(s->sock_fd, addr, addrlen);
+                       if (res < 0 && errno == EISCONN)
+                               res = 0;
                }
        }