mirror of https://github.com/python/cpython
faulthandler: fix the handler of user signals
Restore the errno before calling the previous signal handler, and not after.
This commit is contained in:
parent
652e758fc4
commit
3cc635dabb
|
@ -659,17 +659,22 @@ faulthandler_user(int signum)
|
|||
#ifdef HAVE_SIGACTION
|
||||
if (user->chain) {
|
||||
(void)sigaction(signum, &user->previous, NULL);
|
||||
errno = save_errno;
|
||||
|
||||
/* call the previous signal handler */
|
||||
raise(signum);
|
||||
|
||||
save_errno = errno;
|
||||
(void)faulthandler_register(signum, user->chain, NULL);
|
||||
errno = save_errno;
|
||||
}
|
||||
#else
|
||||
if (user->chain) {
|
||||
errno = save_errno;
|
||||
/* call the previous signal handler */
|
||||
user->previous(signum);
|
||||
}
|
||||
#endif
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue