cpython: cd60eccaa331 (original) (raw)

Mercurial > cpython

changeset 97092:cd60eccaa331 3.5

Issue #24732, #23834: Fix sock_accept_impl() on Windows accept() returns INVALID_SOCKET on error, it's not necessary a negative number. [#24732]

Victor Stinner victor.stinner@gmail.com
date Mon, 27 Jul 2015 23:37:11 +0200
parents d55bdd2dc45e
children 6f98ef46fede 0e8fc11cbfca
files Modules/socketmodule.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-)[+] [-] Modules/socketmodule.c 5

line wrap: on

line diff

--- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2211,7 +2211,12 @@ sock_accept_impl(PySocketSockObject *s, #else ctx->result = accept(s->sock_fd, SAS2SA(ctx->addrbuf), ctx->addrlen); #endif + +#ifdef MS_WINDOWS

+#else return (ctx->result >= 0); +#endif } /* s._accept() -> (fd, address) */