]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Ensure signal handler propagates fatal signals to default handler
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 6 Jul 2011 16:11:03 +0000 (17:11 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 13 Jul 2011 10:47:12 +0000 (11:47 +0100)
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

index 66edd11d54a448692c0853ec08c77b48b9e08194..35f18b9d51179a6f106b288a88fc1e65fdaf04f9 100644 (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