X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=4ea6df0b2abdd550866a1189fc2c72de48106614;hp=f86fb8b26b6111d2acacaeccceb108424441f616;hb=862d63f2e7a7263f3989b6e64dc42e3929ef6f0b;hpb=a6e79f02b6eab623425686f8f3cab5bc942e77d4 diff --git a/server.c b/server.c index f86fb8b2..4ea6df0b 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)); @@ -557,7 +560,7 @@ genocide: } alarm(ALARM_TIMEOUT); close_listed_fds(); - close(sockfd); /* child doesn't need the listener */ + para_signal_shutdown(); /* * put info on who we are serving into argv[0] to make * client ip visible in top/ps