mirror of https://github.com/python/cpython.git
gh-96652: Fix faulthandler chained signal without sigaction() (GH-96666)
Fix the faulthandler implementation of faulthandler.register(signal,
chain=True) if the sigaction() function is not available: don't call
the previous signal handler if it's NULL.
(cherry picked from commit c580a81af9
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
a3d5ecba1c
commit
3d6e6beb0d
|
@ -0,0 +1,3 @@
|
|||
Fix the faulthandler implementation of ``faulthandler.register(signal,
|
||||
chain=True)`` if the ``sigaction()`` function is not available: don't call
|
||||
the previous signal handler if it's NULL. Patch by Victor Stinner.
|
|
@ -862,7 +862,7 @@ faulthandler_user(int signum)
|
|||
errno = save_errno;
|
||||
}
|
||||
#else
|
||||
if (user->chain) {
|
||||
if (user->chain && user->previous != NULL) {
|
||||
errno = save_errno;
|
||||
/* call the previous signal handler */
|
||||
user->previous(signum);
|
||||
|
|
Loading…
Reference in New Issue