From: Daniel P. Berrange Date: Wed, 6 Jul 2011 16:11:03 +0000 (+0100) Subject: Ensure signal handler propagates fatal signals to default handler X-Git-Tag: v0.9.4-rc1~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83d768fab816dccc34fd3fa0d5e56f4ee9597550;p=thirdparty%2Flibvirt.git 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 --- diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 66edd11d54..35f18b9d51 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -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