Introduce signal_shutdown().
authorAndre Noll <maan@systemlinux.org>
Fri, 26 Oct 2007 13:22:58 +0000 (15:22 +0200)
committerAndre Noll <maan@systemlinux.org>
Fri, 26 Oct 2007 13:22:58 +0000 (15:22 +0200)
It allows para_server to close the write end of the signal pipe
before afs is started.

server.c
signal.c
signal.h

index 9b6b55c..4ea6df0 100644 (file)
--- a/server.c
+++ b/server.c
@@ -560,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
index 92f76c7..33449c6 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -143,3 +143,8 @@ int para_next_signal(void)
        }
        return r < 0 && (errno != EAGAIN)? 0 : -E_SIGNAL_READ;
 }
+
+void para_signal_shutdown(void)
+{
+       close(signal_pipe[1]);
+}
index 5df64c3..9a7a527 100644 (file)
--- a/signal.h
+++ b/signal.h
@@ -23,3 +23,4 @@ int para_install_sighandler(int);
 void para_reap_children(void);
 int para_reap_child(pid_t *pid);
 int para_next_signal(void);
+void para_signal_shutdown(void);