diff options
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -26,6 +26,7 @@ #include <errno.h> #include <event.h> #include <fcntl.h> +#include <signal.h> #include <stdlib.h> #include <string.h> #include <unistd.h> @@ -437,15 +438,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: |