[PATCH] git-daemon: SysV needs the signal handler reinstated.
- From
Stephen R. van den Berg <srb@cuci.nl>
- Date
- Aug 12, 2008, 19:36 UTC
- Message-ID
- <20080812193613.32388.92145.stgit@aristoteles.cuci.nl>
Fixes the bug on (amongst others) Solaris that only the first child ever is reaped.
Signed-off-by: Stephen R. van den Berg <srb@cuci.nl> ---
daemon.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/daemon.c b/daemon.c index 4540e8d..1c00305 100644 --- a/daemon.c +++ b/daemon.c @@ -794,6 +794,7 @@ static void child_handler(int signo) } break; } + signal(SIGCHLD, child_handler); } static int set_reuse_addr(int sockfd) @@ -947,7 +948,7 @@ static int service_loop(int socknum, int *socklist) pfd[socknum].fd = child_handler_pipe[0]; pfd[socknum].events = POLLIN; - signal(SIGCHLD, child_handler); + child_handler(0); for (;;) { int i;