diff Modules/selectmodule.c @ 25403:51cdf470f974 2.2

backport of the checkin of revision 2.69 of selectmodule.c On Windows, call WSAGetLastError() to retrieve the error number. Bugfix candidate, will backport to release22-maint myself.
author Thomas Heller <theller@ctypes.org>
date Tue, 24 Sep 2002 17:24:25 +0000
parents e223397b26fa
children faffb11f54e8
line wrap: on
line diff
--- a/Modules/selectmodule.c	Tue Sep 24 17:17:38 2002 +0000
+++ b/Modules/selectmodule.c	Tue Sep 24 17:24:25 2002 +0000
@@ -268,9 +268,16 @@
 	n = select(max, &ifdset, &ofdset, &efdset, tvp);
 	Py_END_ALLOW_THREADS
 
+#ifdef MS_WINDOWS
+	if (n == SOCKET_ERROR) {
+		errno = WSAGetLastError();
+		PyErr_SetFromErrno(SelectError);
+	}
+#else
 	if (n < 0) {
 		PyErr_SetFromErrno(SelectError);
 	}
+#endif
 	else if (n == 0) {
                 /* optimization */
 		ifdlist = PyList_New(0);