X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=febfe2ad02ca2828c1dffe65d2243ed8b661e605;hp=f86fb8b26b6111d2acacaeccceb108424441f616;hb=c3e4fbf24713e3df4e191681448b489710ada631;hpb=a6e79f02b6eab623425686f8f3cab5bc942e77d4 diff --git a/server.c b/server.c index f86fb8b2..febfe2ad 100644 --- a/server.c +++ b/server.c @@ -23,8 +23,8 @@ * * The gory details, listed by topic: * - * - Audio format handlers: \ref mp3_afh.c, \ref ogg_afh.c \ref aac_afh.c, - * - Decoders: \ref mp3dec.c, \ref \ref oggdec.c, \ref aacdec.c, + * - Audio format handlers: \ref mp3_afh.c, \ref ogg_afh.c, \ref aac_afh.c, + * - Decoders: \ref mp3dec.c, \ref oggdec.c, \ref aacdec.c, * - Volume normalizer: \ref compress.c, * - Output: \ref alsa_write.c, \ref osx_write.c, * - http: \ref http_recv.c, \ref http_send.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