From: Max Kellermann Date: Fri, 3 Oct 2008 13:24:01 +0000 (+0200) Subject: don't initialize sigaction struct twice X-Git-Tag: v0.12_alpha1~72 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=466530d2506d7bcea3d2d546a471bf51b78f85e7;p=ncmpc.git don't initialize sigaction struct twice Don't reset sa_mask and sa_flags after every sigaction() call. Do it once. --- diff --git a/src/main.c b/src/main.c index 5bb2538..5c2d0e5 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)");