From: Pierre Habouzit Date: Sat, 1 Dec 2007 14:16:51 +0000 (+0100) Subject: fix SIGINT in the blocking mode for linux. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=56a19a8613320e662932e4c372a909c1e8dfdd77;p=apps%2Fpfixtools.git fix SIGINT in the blocking mode for linux. Signed-off-by: Pierre Habouzit --- diff --git a/main-postlicyd.c b/main-postlicyd.c index ff5097f..57633d3 100644 --- a/main-postlicyd.c +++ b/main-postlicyd.c @@ -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);