From 466530d2506d7bcea3d2d546a471bf51b78f85e7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 3 Oct 2008 15:24:01 +0200 Subject: don't initialize sigaction struct twice Don't reset sa_mask and sa_flags after every sigaction() call. Do it once. --- src/main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 5bb2538f1..5c2d0e52c 100644 --- a/src/main.c +++ b/src/main.c @@ -370,8 +370,7 @@ main(int argc, const char *argv[]) } /* setup signal behavior - SIGTERM */ - sigemptyset(&act.sa_mask); - act.sa_flags = 0; + act.sa_handler = catch_sigint; if (sigaction(SIGTERM, &act, NULL) < 0) { perror("sigaction()"); @@ -379,8 +378,7 @@ main(int argc, const char *argv[]) } /* setup signal behavior - SIGCONT */ - sigemptyset(&act.sa_mask); - act.sa_flags = 0; + act.sa_handler = catch_sigcont; if (sigaction(SIGCONT, &act, NULL) < 0) { perror("sigaction(SIGCONT)"); @@ -388,8 +386,7 @@ main(int argc, const char *argv[]) } /* setup signal behaviour - SIGHUP*/ - sigemptyset(&act.sa_mask); - act.sa_flags = 0; + act.sa_handler = catch_sigint; if (sigaction(SIGHUP, &act, NULL) < 0) { perror("sigaction(SIGHUP)"); -- cgit v1.2.3