diff options
author | Max Kellermann <max@duempel.org> | 2008-10-03 15:24:01 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-03 15:24:01 +0200 |
commit | 466530d2506d7bcea3d2d546a471bf51b78f85e7 (patch) | |
tree | dd4300e78f7a11b5f86d3d4762d4ff38fee49539 | |
parent | 34f726e6beb1dc37386338b6d9d85b2a9ff4f019 (diff) | |
download | mpd-466530d2506d7bcea3d2d546a471bf51b78f85e7.tar.gz mpd-466530d2506d7bcea3d2d546a471bf51b78f85e7.tar.xz mpd-466530d2506d7bcea3d2d546a471bf51b78f85e7.zip |
don't initialize sigaction struct twice
Don't reset sa_mask and sa_flags after every sigaction() call. Do it
once.
-rw-r--r-- | src/main.c | 9 |
1 files 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)"); |