From: Adam Dickmeiss Date: Tue, 1 May 2012 20:38:43 +0000 (+0200) Subject: daemon: exit monitor process for SIG{HUP,TERM,USR1} X-Git-Tag: v4.2.33~5^2~1 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=ab4fa4869bf147f316b418e6c1a24807d82ed5f6 daemon: exit monitor process for SIG{HUP,TERM,USR1} It ensures that binding socket is closed in monitor process. It also ensures that even if child process makes a failure during termination, SIGSEGV or other, monitor process also terminates. --- diff --git a/src/daemon.c b/src/daemon.c index 82d1c9e..5d7979d 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -66,7 +66,10 @@ pid_t child_pid = 0; static void kill_child_handler(int num) { if (child_pid) + { kill(child_pid, num); + _exit(0); + } } static void keepalive(void (*work)(void *data), void *data)