aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-03 15:24:01 +0200
committerMax Kellermann <max@duempel.org>2008-10-03 15:24:01 +0200
commit466530d2506d7bcea3d2d546a471bf51b78f85e7 (patch)
treedd4300e78f7a11b5f86d3d4762d4ff38fee49539
parent34f726e6beb1dc37386338b6d9d85b2a9ff4f019 (diff)
downloadmpd-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.c9
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)");