summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-07-22 15:26:53 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-07-22 15:26:53 (GMT)
commit0cec877230a9232378eb2c7e21348029bbe83fea (patch)
tree9cdb408bcab4e855f19faa6a16ee73735eb52b1c
parent48e3f9820623a7a27e1c7edffa840d90c5a25cdd (diff)
downloadcpython-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
-rw-r--r--Modules/socketmodule.c2
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