new setSigHandlersForDecoder() function, and be sure player/decode processes ignore SIGHUP signals

git-svn-id: https://svn.musicpd.org/mpd/trunk@2492 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes
2004-11-03 14:29:37 +00:00
parent 118acc5875
commit c5ce5f3c01
4 changed files with 19 additions and 13 deletions

View File

@@ -105,20 +105,12 @@ int playerInit() {
player_pid = fork();
if(player_pid==0) {
PlayerControl * pc = &(getPlayerData()->playerControl);
struct sigaction sa;
clearUpdatePid();
unblockSignals();
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
finishSigHandlers();
sa.sa_handler = 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);
setSigHandlersForDecoder();
while(close(listenSocket)<0 && errno==EINTR);
freeAllInterfaces();