From: Andre Noll Date: Fri, 26 Oct 2007 13:20:08 +0000 (+0200) Subject: server.c: Add more fds to the close on ofork list. X-Git-Tag: v0.3.0~186 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=c3f50561d5850d3b31ef84792c49ebc984161259;p=paraslash.git server.c: Add more fds to the close on ofork list. --- diff --git a/server.c b/server.c index f86fb8b2..9b6b55c9 100644 --- a/server.c +++ b/server.c @@ -287,7 +287,8 @@ static void setup_signal_handling(void) 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); @@ -298,6 +299,7 @@ static void setup_signal_handling(void) 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) @@ -310,6 +312,7 @@ 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));