Signed-off-by: Pierre Habouzit <madcoder@debian.org>
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:
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;