charon-cmd: Block SIGUSR1 on worker threads
authorMartin Willi <martin@revosec.ch>
Tue, 4 Feb 2014 10:14:27 +0000 (11:14 +0100)
committerMartin Willi <martin@revosec.ch>
Thu, 6 Feb 2014 14:57:36 +0000 (15:57 +0100)
To properly shut down charon-cmd with leak reports, only the main thread
should catch SIGUSR1 to shut down the application. Work threads should ignore
SIGUSR1 to avoid any hard application termination.

src/charon-cmd/charon-cmd.c

index 5f4787b..0c24fd1 100644 (file)
@@ -389,6 +389,7 @@ int main(int argc, char *argv[])
        sigaddset(&action.sa_mask, SIGINT);
        sigaddset(&action.sa_mask, SIGTERM);
        sigaddset(&action.sa_mask, SIGHUP);
+       sigaddset(&action.sa_mask, SIGUSR1);
        sigaction(SIGSEGV, &action, NULL);
        sigaction(SIGILL, &action, NULL);
        sigaction(SIGBUS, &action, NULL);