From 15170c79d28c51112c13904aebb337e9a42aa6a1 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 19 Apr 2014 20:47:01 +1000 Subject: [PATCH] Original sighandlers don't actually come in useful here --- src/ckpool.c | 7 ++----- src/libckpool.h | 4 ---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/ckpool.c b/src/ckpool.c index 2e25a452..c94bc928 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -153,9 +153,6 @@ static void shutdown_children(ckpool_t *ckp, int sig) static void sighandler(int sig) { - /* Restore signal handlers so we can still quit if shutdown fails */ - sigaction(SIGTERM, &global_ckp->termhandler, NULL); - sigaction(SIGINT, &global_ckp->inthandler, NULL); shutdown_children(global_ckp, sig); clean_up(global_ckp); exit(0); @@ -219,8 +216,8 @@ int main(int argc, char **argv) handler.sa_handler = &sighandler; handler.sa_flags = 0; sigemptyset(&handler.sa_mask); - sigaction(SIGTERM, &handler, &ckp.termhandler); - sigaction(SIGINT, &handler, &ckp.inthandler); + sigaction(SIGTERM, &handler, NULL); + sigaction(SIGINT, &handler, NULL); /* Shutdown from here */ join_pthread(pth_listener); diff --git a/src/libckpool.h b/src/libckpool.h index 899c786b..fad3d077 100644 --- a/src/libckpool.h +++ b/src/libckpool.h @@ -145,10 +145,6 @@ struct ckpool_instance { /* Process instances of child processes */ proc_instance_t main; proc_instance_t generator; - - /* Original signal handlers */ - struct sigaction termhandler; - struct sigaction inthandler; }; void create_pthread(pthread_t *thread, void *(*start_routine)(void *), void *arg);