aboutsummaryrefslogtreecommitdiffstats
path: root/src/sig_handlers.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2005-03-08 00:17:33 +0000
committerWarren Dukes <warren.dukes@gmail.com>2005-03-08 00:17:33 +0000
commit6a77e60c70d128af4b0fc0ea2a520e9b20411abc (patch)
tree5588bc70a092b144ac1da6ff70dddf6e76e06a6b /src/sig_handlers.c
parent3764b0608348815a9a8c59a0e4cb28236d82cb7d (diff)
downloadmpd-6a77e60c70d128af4b0fc0ea2a520e9b20411abc.tar.gz
mpd-6a77e60c70d128af4b0fc0ea2a520e9b20411abc.tar.xz
mpd-6a77e60c70d128af4b0fc0ea2a520e9b20411abc.zip
now player and decoder processes should only exit() when receiving term signal from their respective parent processes
git-svn-id: https://svn.musicpd.org/mpd/trunk@3034 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/sig_handlers.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sig_handlers.c b/src/sig_handlers.c
index 4ab5163bf..4c7b99635 100644
--- a/src/sig_handlers.c
+++ b/src/sig_handlers.c
@@ -74,6 +74,7 @@ void initSigHandlers() {
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sa.sa_handler = SIG_IGN;
+ sa.sa_sigaction = NULL;
while(sigaction(SIGPIPE,&sa,NULL)<0 && errno==EINTR);
sa.sa_handler = chldSigHandler;
while(sigaction(SIGCHLD,&sa,NULL)<0 && errno==EINTR);
@@ -98,8 +99,11 @@ void setSigHandlersForDecoder() {
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sa.sa_handler = SIG_IGN;
+ sa.sa_sigaction = NULL;
while(sigaction(SIGHUP,&sa,NULL)<0 && errno==EINTR);
- sa.sa_handler = decodeSigHandler;
+ sa.sa_handler = NULL;
+ sa.sa_flags = SA_SIGINFO;
+ sa.sa_sigaction = decodeSigHandler;
while(sigaction(SIGCHLD,&sa,NULL)<0 && errno==EINTR);
while(sigaction(SIGTERM,&sa,NULL)<0 && errno==EINTR);
while(sigaction(SIGINT,&sa,NULL)<0 && errno==EINTR);
@@ -111,6 +115,7 @@ void ignoreSignals() {
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sa.sa_handler = SIG_IGN;
+ sa.sa_sigaction = NULL;
while(sigaction(SIGPIPE,&sa,NULL)<0 && errno==EINTR);
while(sigaction(SIGCHLD,&sa,NULL)<0 && errno==EINTR);
while(sigaction(SIGUSR1,&sa,NULL)<0 && errno==EINTR);