diff options
author | nicm <nicm> | 2014-10-01 23:23:19 +0000 |
---|---|---|
committer | nicm <nicm> | 2014-10-01 23:23:19 +0000 |
commit | 045d0c3b9f616fe76b68d4551a6d66f410e760e8 (patch) | |
tree | 484cffbd2b54910b04ee534fa228dc56957d1818 | |
parent | a54b0055f66bc2d27bd57fc3f818dc185118470f (diff) | |
download | rtmux-045d0c3b9f616fe76b68d4551a6d66f410e760e8.tar.gz rtmux-045d0c3b9f616fe76b68d4551a6d66f410e760e8.tar.bz2 rtmux-045d0c3b9f616fe76b68d4551a6d66f410e760e8.zip |
Call waitpid on SIGCHLD even if client not attached, it is possible (on
very slow platforms) for the first daemon() child to still be running
when client_attached is set so we end up with a zombie. From J Raynor.
-rw-r--r-- | client.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -433,15 +433,11 @@ client_signal(int sig, unused short events, unused void *data) struct sigaction sigact; int status; - if (!client_attached) { - switch (sig) { - case SIGCHLD: - waitpid(WAIT_ANY, &status, WNOHANG); - break; - case SIGTERM: + if (sig == SIGCHLD) + waitpid(WAIT_ANY, &status, WNOHANG); + else if (!client_attached) { + if (sig == SIGTERM) event_loopexit(NULL); - break; - } } else { switch (sig) { case SIGHUP: |