mirror of
https://github.com/python/cpython.git
synced 2025-10-22 14:42:22 +00:00
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
1 changed files with 7 additions and 1 deletions
|
@ -2589,7 +2589,13 @@ sock_connect_impl(PySocketSockObject *s, void* Py_UNUSED(data))
|
||||||
|
|
||||||
if (err == EISCONN)
|
if (err == EISCONN)
|
||||||
return 1;
|
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
|
static int
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue