mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
39c0721d7b
commit
38aec7525e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue