From 7a3352c3c6969a3019fd4adb3a957c711441160e Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 26 Oct 2007 15:22:58 +0200 Subject: [PATCH 1/1] Introduce signal_shutdown(). It allows para_server to close the write end of the signal pipe before afs is started. --- server.c | 2 +- signal.c | 5 +++++ signal.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) 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); -- 2.39.2