From a8eee6f0a3f7bb09bff8a58005e801bde6cfd13c Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 26 Jun 2014 09:21:07 +0300 Subject: [PATCH] We cannot intercept signal 9 --- src/ckpool.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/ckpool.c b/src/ckpool.c index a9f234c1..7f45025b 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -700,17 +700,12 @@ static void sighandler(int sig) pthread_cancel(ckp->pth_watchdog); join_pthread(ckp->pth_watchdog); - if (sig != 9) { - __shutdown_children(ckp, SIGTERM); - /* Wait a second, then send SIGKILL */ - sleep(1); - __shutdown_children(ckp, SIGKILL); - pthread_cancel(ckp->pth_listener); - exit(0); - } else { - __shutdown_children(ckp, SIGKILL); - exit(1); - } + __shutdown_children(ckp, SIGTERM); + /* Wait a second, then send SIGKILL */ + sleep(1); + __shutdown_children(ckp, SIGKILL); + pthread_cancel(ckp->pth_listener); + exit(0); } static void json_get_string(char **store, json_t *val, const char *res)