fix SIGINT in the blocking mode for linux.
authorPierre Habouzit <madcoder@debian.org>
Sat, 1 Dec 2007 14:16:51 +0000 (15:16 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sat, 1 Dec 2007 14:16:51 +0000 (15:16 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
main-postlicyd.c

index ff5097f..57633d3 100644 (file)
@@ -228,9 +228,14 @@ static void *policy_run(int fd, void *data)
 
 static int main_initialize(void)
 {
+    struct sigaction sa;
+
     openlog("postlicyd", LOG_PID, LOG_MAIL);
     signal(SIGPIPE, SIG_IGN);
-    signal(SIGINT,  &common_sighandler);
+    sigaction(SIGINT, NULL, &sa);
+    sa.sa_handler = &common_sighandler;
+    sa.sa_flags  &= ~SA_RESTART;
+    sigaction(SIGINT, &sa, NULL);
     signal(SIGTERM, &common_sighandler);
     signal(SIGHUP,  &common_sighandler);
     signal(SIGSEGV, &common_sighandler);