From 83d768fab816dccc34fd3fa0d5e56f4ee9597550 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 6 Jul 2011 17:11:03 +0100 Subject: [PATCH] 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 --- src/rpc/virnetserver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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