From: Pierre Habouzit Date: Sat, 1 Dec 2007 14:07:47 +0000 (+0100) Subject: Simplify sigint handler. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=e19b9956a229a2197ec33175f1da59629192c3aa;p=apps%2Fpfixtools.git Simplify sigint handler. Signed-off-by: Pierre Habouzit --- diff --git a/common.c b/common.c index 3addd0e..d00461b 100644 --- a/common.c +++ b/common.c @@ -47,18 +47,9 @@ static FILE *pidfile = NULL; void common_sighandler(int sig) { - static time_t lastintr = 0; - time_t now = time(NULL); - switch (sig) { case SIGINT: - if (sigint) { - if (now - lastintr >= 1) - break; - } else { - lastintr = now; - sigint = true; - } + sigint = true; return; case SIGHUP: diff --git a/main-postlicyd.c b/main-postlicyd.c index 51f56ef..ff5097f 100644 --- a/main-postlicyd.c +++ b/main-postlicyd.c @@ -232,6 +232,7 @@ static int main_initialize(void) signal(SIGPIPE, SIG_IGN); signal(SIGINT, &common_sighandler); signal(SIGTERM, &common_sighandler); + signal(SIGHUP, &common_sighandler); signal(SIGSEGV, &common_sighandler); syslog(LOG_INFO, "Starting..."); return 0;