accept() returns INVALID_SOCKET on error, it's not necessary a negative number.
This commit is contained in:
parent
0659c43d73
commit
bea232a15f
|
@ -2211,7 +2211,12 @@ sock_accept_impl(PySocketSockObject *s, void *data)
|
||||||
#else
|
#else
|
||||||
ctx->result = accept(s->sock_fd, SAS2SA(ctx->addrbuf), ctx->addrlen);
|
ctx->result = accept(s->sock_fd, SAS2SA(ctx->addrbuf), ctx->addrlen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MS_WINDOWS
|
||||||
|
return (ctx->result != INVALID_SOCKET);
|
||||||
|
#else
|
||||||
return (ctx->result >= 0);
|
return (ctx->result >= 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* s._accept() -> (fd, address) */
|
/* s._accept() -> (fd, address) */
|
||||||
|
|
Loading…
Reference in New Issue