server.c: Add more fds to the close on ofork list.
authorAndre Noll <maan@systemlinux.org>
Fri, 26 Oct 2007 13:20:08 +0000 (15:20 +0200)
committerAndre Noll <maan@systemlinux.org>
Fri, 26 Oct 2007 13:20:08 +0000 (15:20 +0200)
server.c

index f86fb8b..9b6b55c 100644 (file)
--- 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));