Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0cec877

Browse files
committed
socket: Fix internal_select()
Bug found by Pavel Belikov ("Fragment N1"): http://www.viva64.com/en/b/0414/#ID0ECDAE
1 parent 48e3f98 commit 0cec877

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/socketmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ internal_select(PySocketSockObject *s, int writing, _PyTime_t interval,
648648
assert(!(connect && !writing));
649649

650650
/* Guard against closed socket */
651-
if (s->sock_fd < 0)
651+
if (s->sock_fd == INVALID_SOCKET)
652652
return 0;
653653

654654
/* Prefer poll, if available, since you can poll() any fd

0 commit comments

Comments
 (0)