diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-07-22 15:26:53 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-07-22 15:26:53 (GMT) |
commit | 0cec877230a9232378eb2c7e21348029bbe83fea (patch) | |
tree | 9cdb408bcab4e855f19faa6a16ee73735eb52b1c /Modules | |
parent | 48e3f9820623a7a27e1c7edffa840d90c5a25cdd (diff) | |
download | cpython-0cec877230a9232378eb2c7e21348029bbe83fea.zip cpython-0cec877230a9232378eb2c7e21348029bbe83fea.tar.gz cpython-0cec877230a9232378eb2c7e21348029bbe83fea.tar.bz2 |
socket: Fix internal_select()
Bug found by Pavel Belikov ("Fragment N1"):
http://www.viva64.com/en/b/0414/#ID0ECDAE
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/socketmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 8f571a2..8e804af 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -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 |