mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 13:35:17 +00:00
Ensure signal handler propagates fatal signals to default handler
When replacing the default SEGV/ABORT/BUS signal handlers you can't rely on the process being terminated after your custom handler runs. It is neccessary to manually restore the default handler and then re-raise the signal * src/rpc/virnetserver.c: Restore default handler and raise signal
This commit is contained in:
parent
1a81687ad2
commit
83d768fab8
@ -264,8 +264,9 @@ static void virNetServerFatalSignal(int sig, siginfo_t *siginfo ATTRIBUTE_UNUSED
|
|||||||
#ifdef SIGUSR2
|
#ifdef SIGUSR2
|
||||||
if (sig != SIGUSR2) {
|
if (sig != SIGUSR2) {
|
||||||
#endif
|
#endif
|
||||||
sig_action.sa_handler = SIG_IGN;
|
sig_action.sa_handler = SIG_DFL;
|
||||||
sigaction(sig, &sig_action, NULL);
|
sigaction(sig, &sig_action, NULL);
|
||||||
|
raise(sig);
|
||||||
#ifdef SIGUSR2
|
#ifdef SIGUSR2
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user