Browse Source

Original sighandlers don't actually come in useful here

master
Con Kolivas 11 years ago
parent
commit
15170c79d2
  1. 7
      src/ckpool.c
  2. 4
      src/libckpool.h

7
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);

4
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);

Loading…
Cancel
Save