Commit 106f4c7b authored by Thomas Heller's avatar Thomas Heller

On Windows, call WSAGetLastError() to retrieve the error number.

Bugfix candidate, will backport to release22-maint myself.
parent 2f93644c
......@@ -39,7 +39,7 @@ extern void bzero(void *, int);
#endif
#ifdef MS_WINDOWS
#include <winsock.h>
#include <windows.h>
#else
#ifdef __BEOS__
#include <net/socket.h>
......@@ -273,9 +273,15 @@ select_select(PyObject *self, PyObject *args)
n = select(max, &ifdset, &ofdset, &efdset, tvp);
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 */
ifdlist = PyList_New(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment