faulthandler: fix the handler of user signals

Restore the errno before calling the previous signal handler, and not after.
This commit is contained in:
Victor Stinner 2012-08-09 02:43:41 +02:00
parent 652e758fc4
commit 3cc635dabb
1 changed files with 6 additions and 1 deletions

View File

@ -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