int ret = 0;
signal_pipe = para_signal_init();
- PARA_NOTICE_LOG("%s", "setting up signal handlers\n");
+
+ PARA_NOTICE_LOG("setting up signal handlers\n");
ret += para_install_sighandler(SIGINT);
ret += para_install_sighandler(SIGTERM);
ret += para_install_sighandler(SIGHUP);
PARA_EMERG_LOG("%s", "could not install signal handlers\n");
exit(EXIT_FAILURE);
}
+ add_close_on_fork_list(signal_pipe);
}
static unsigned init_network(void)
ret = mark_fd_nonblock(fd);
if (ret < 0)
goto err;
+ add_close_on_fork_list(fd); /* child doesn't need the listener */
return fd;
err:
PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));