diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2005-03-08 00:17:33 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2005-03-08 00:17:33 +0000 |
commit | 6a77e60c70d128af4b0fc0ea2a520e9b20411abc (patch) | |
tree | 5588bc70a092b144ac1da6ff70dddf6e76e06a6b /src/decode.c | |
parent | 3764b0608348815a9a8c59a0e4cb28236d82cb7d (diff) | |
download | mpd-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 'src/decode.c')
-rw-r--r-- | src/decode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/decode.c b/src/decode.c index 4416552e1..32deb075a 100644 --- a/src/decode.c +++ b/src/decode.c @@ -39,7 +39,7 @@ volatile int * volatile decode_pid = NULL; -void decodeSigHandler(int sig) { +void decodeSigHandler(int sig, siginfo_t * si, void * v) { if(sig==SIGCHLD) { int status; if(decode_pid && *decode_pid==wait3(&status,WNOHANG,NULL)) { @@ -52,7 +52,8 @@ void decodeSigHandler(int sig) { *decode_pid = 0; } } - else if(sig==SIGTERM) { + else if(sig==SIGTERM && si->si_pid==getppid()) { + DEBUG("player/decoder got SIGTERM from parent process\n"); if(decode_pid) { int pid = *decode_pid; if(pid>0) kill(pid,SIGTERM); |