mirror of
https://github.com/python/cpython.git
synced 2026-01-26 21:03:34 +00:00
[3.14] gh-137490: Fix signal.sigwaitinfo() on NetBSD (GH-137523) (GH-138935)
Handle ECANCELED in the same way as EINTR to work around the Posix violation in the NetBSD's implementation. (cherry picked from commit 07d0b95b05dfaf5832f44c2fbc956761f9e29571) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
cbd532f2e8
commit
4e8f5e65eb
@ -0,0 +1,2 @@
|
||||
Handle :data:`~errno.ECANCELED` in the same way as :data:`~errno.EINTR` in
|
||||
:func:`signal.sigwaitinfo` on NetBSD.
|
||||
@ -1180,7 +1180,13 @@ signal_sigwaitinfo_impl(PyObject *module, sigset_t sigset)
|
||||
err = sigwaitinfo(&sigset, &si);
|
||||
Py_END_ALLOW_THREADS
|
||||
} while (err == -1
|
||||
&& errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
||||
&& (errno == EINTR
|
||||
#if defined(__NetBSD__)
|
||||
/* NetBSD's implementation violates POSIX by setting
|
||||
* errno to ECANCELED instead of EINTR. */
|
||||
|| errno == ECANCELED
|
||||
#endif
|
||||
) && !(async_err = PyErr_CheckSignals()));
|
||||
if (err == -1)
|
||||
return (!async_err) ? PyErr_SetFromErrno(PyExc_OSError) : NULL;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user