[Python-checkins] python/dist/src/Modules selectmodule.c,2.68,2.69
theller@users.sourceforge.net
theller@users.sourceforge.net
Tue, 24 Sep 2002 09:51:02 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv3882
Modified Files:
selectmodule.c
Log Message:
On Windows, call WSAGetLastError() to retrieve the error number.
Bugfix candidate, will backport to release22-maint myself.
Index: selectmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/selectmodule.c,v
retrieving revision 2.68
retrieving revision 2.69
diff -C2 -d -r2.68 -r2.69
*** selectmodule.c 28 Jul 2002 15:12:10 -0000 2.68
--- selectmodule.c 24 Sep 2002 16:51:00 -0000 2.69
***************
*** 40,44 ****
#ifdef MS_WINDOWS
! #include <winsock.h>
#else
#ifdef __BEOS__
--- 40,44 ----
#ifdef MS_WINDOWS
! #include <windows.h>
#else
#ifdef __BEOS__
***************
*** 274,280 ****
--- 274,286 ----
Py_END_ALLOW_THREADS
+ #ifdef MS_WINDOWS
+ if (n == SOCKET_ERROR) {
+ PyErr_SetExcFromWindowsErr(SelectError, WSAGetLastError());
+ }
+ #else
if (n < 0) {
PyErr_SetFromErrno(SelectError);
}
+ #endif
else if (n == 0) {
/* optimization */