diff Modules/socketmodule.c @ 24677:479cb5ff2e60 legacy-trunk

The other half of the patches added to SF patch 555085 by A I MacIntyre. At least on OS/2, a subsequent connect() on a nonblocking socket returns errno==EISCONN to indicate success. This seems harmless on Unix.
author Guido van Rossum <guido@python.org>
date Thu, 08 Aug 2002 20:39:30 +0000
parents 980767c6cd97
children 8b470281645e
line wrap: on
line diff
--- a/Modules/socketmodule.c	Thu Aug 08 20:37:08 2002 +0000
+++ b/Modules/socketmodule.c	Thu Aug 08 20:39:30 2002 +0000
@@ -1327,6 +1327,8 @@
 		if (res < 0 && errno == EINPROGRESS) {
 			internal_select(s, 1);
 			res = connect(s->sock_fd, addr, addrlen);
+			if (res < 0 && errno == EISCONN)
+				res = 0;
 		}
 	}