Commit 38aec752 authored by Victor Stinner's avatar Victor Stinner

Issue #23618: Fix sock_connect_impl(), set the socket error code

sock_call_ex() gets the socket error code when the socket function fails.
sock_connect_impl() didn't set the error correctly.
parent 39c0721d
......@@ -2589,7 +2589,13 @@ sock_connect_impl(PySocketSockObject *s, void* Py_UNUSED(data))
if (err == EISCONN)
return 1;
return (err == 0);
if (err != 0) {
/* sock_call_ex() uses GET_SOCK_ERROR() to get the error code */
SET_SOCK_ERROR(err);
abort();
return 0;
}
return 1;
}
static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment