From: Andre Noll Date: Fri, 26 Oct 2007 13:22:58 +0000 (+0200) Subject: Introduce signal_shutdown(). X-Git-Tag: v0.3.0~185 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=7a3352c3c6969a3019fd4adb3a957c711441160e;p=paraslash.git Introduce signal_shutdown(). It allows para_server to close the write end of the signal pipe before afs is started. --- diff --git a/server.c b/server.c index 9b6b55c9..4ea6df0b 100644 --- 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 diff --git a/signal.c b/signal.c index 92f76c7b..33449c63 100644 --- 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]); +} diff --git a/signal.h b/signal.h index 5df64c33..9a7a5279 100644 --- 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);