diff --git a/signal.c b/signal.c index e642399..8b594cb 100644 --- a/signal.c +++ b/signal.c @@ -16,8 +16,18 @@ int stopped() void set_intr() { - signal(SIGINT, stopall); + struct sigaction sig; + + sig.sa_handler = stopall; + sigemptyset(&sig.sa_mask); + //sigaddset(&new.sa_mask, SIGINT); + //sigaddset(&new.sa_mask, SIGALRM); + sig.sa_flags = 0; + //sigaction(SIGINT, NULL, &old); + //if (old_action.sa_handler != SIG_IGN) { + sigaction(SIGINT, &sig, NULL); + sigaction(SIGALRM, &sig, NULL); # ifdef DEBUG - printf("SIGINT armed.\n"); + printf("SIGINT and SIGALRM armed.\n"); # endif }