socket: Fix internal_select()

Bug found by Pavel Belikov ("Fragment N1"):
http://www.viva64.com/en/b/0414/#ID0ECDAE
This commit is contained in:
Victor Stinner 2016-07-22 17:26:53 +02:00
parent 48e3f98206
commit 0cec877230
1 changed files with 1 additions and 1 deletions

View File

@ -648,7 +648,7 @@ internal_select(PySocketSockObject *s, int writing, _PyTime_t interval,
assert(!(connect && !writing));
/* Guard against closed socket */
if (s->sock_fd < 0)
if (s->sock_fd == INVALID_SOCKET)
return 0;
/* Prefer poll, if available, since you can poll() any fd