Author: reimar Date: Wed Apr 15 23:44:02 2015 New Revision: 37387 Log: Reinstall SIGCHLD handler after handling the signal. This seems necessary at least on Linux, otherwise we handle only the first child process. Modified: trunk/mplayer.c Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Wed Apr 1 00:15:36 2015 (r37386) +++ trunk/mplayer.c Wed Apr 15 23:44:02 2015 (r37387) @@ -785,6 +785,9 @@ static void child_sighandler(int x) do { pid = waitpid(-1, NULL, WNOHANG); } while (pid > 0); + // Without this, we will be called only once at + // least on Linux 3.16. + signal(SIGCHLD, child_sighandler); } #endif @@ -3024,6 +3027,8 @@ int main(int argc, char *argv[]) // Catch signals #ifndef __MINGW32__ + // TODO: use newer POSIX SIG_IGN behaviour instead to + // automatically handle children? signal(SIGCHLD, child_sighandler); #endif
participants (1)
-
reimar