]> git.tue.mpg.de Git - paraslash.git/commitdiff
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 9b6b55c9397161ceec4d60c317dbfec90cbc831b..4ea6df0b2abdd550866a1189fc2c72de48106614 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 92f76c7b181b6c665f552ef5859c69ac3e6a891e..33449c632f5214e5acd464faeeae079b0701f0d5 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 5df64c33f7e0a6b8a441efef82b04c355fc62a2d..9a7a52791aecd81f451cdee85ec187f5b1903007 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);