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:
Daniel P. Berrange 2011-07-06 17:11:03 +01:00
parent 1a81687ad2
commit 83d768fab8

View File

@ -264,8 +264,9 @@ static void virNetServerFatalSignal(int sig, siginfo_t *siginfo ATTRIBUTE_UNUSED
#ifdef SIGUSR2
if (sig != SIGUSR2) {
#endif
sig_action.sa_handler = SIG_IGN;
sig_action.sa_handler = SIG_DFL;
sigaction(sig, &sig_action, NULL);
raise(sig);
#ifdef SIGUSR2
}
#endif