[Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.190,1.191

Tim Peters tim_one@users.sourceforge.net
2001年10月29日 17:26:51 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv6912/python/Modules
Modified Files:
	socketmodule.c 
Log Message:
PySocketSock_connect_ex(): On Windows, return the correct Windows exit
code. The patch is from Jeremy, and allows test_asynchat to run again.
Bugfix candidate.
Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -C2 -d -r1.190 -r1.191
*** socketmodule.c	2001年10月28日 12:31:33	1.190
--- socketmodule.c	2001年10月30日 01:26:49	1.191
***************
*** 1268,1273 ****
 	res = connect(s->sock_fd, addr, addrlen);
 	Py_END_ALLOW_THREADS
! 	if (res != 0)
 		res = errno;
 	return PyInt_FromLong((long) res);
 }
--- 1268,1278 ----
 	res = connect(s->sock_fd, addr, addrlen);
 	Py_END_ALLOW_THREADS
! 	if (res != 0) {
! #ifdef MS_WINDOWS
! 		res = WSAGetLastError();
! #else
 		res = errno;
+ #endif
+ 	}
 	return PyInt_FromLong((long) res);
 }

AltStyle によって変換されたページ (->オリジナル) /