X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fdaemon.c;h=82d1c9e5c3c5c9667bbb5853d1c205735d3a7e3b;hb=92085e57d085092c52e9b2ad9e0ee1405c0200c8;hp=69c2330c0d767f3468e38a1e05f3c7ede6a40648;hpb=f4294538bbeb77c910b083f1d385cf98d752e5b2;p=yaz-moved-to-github.git diff --git a/src/daemon.c b/src/daemon.c index 69c2330..82d1c9e 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2010 Index Data + * Copyright (C) 1995-2012 Index Data * See the file LICENSE for details. */ @@ -75,12 +75,14 @@ static void keepalive(void (*work)(void *data), void *data) int cont = 1; void (*old_sighup)(int); void (*old_sigterm)(int); + void (*old_sigusr1)(int); /* keep signals in their original state and make sure that some signals to parent process also gets sent to the child.. */ old_sighup = signal(SIGHUP, kill_child_handler); old_sigterm = signal(SIGTERM, kill_child_handler); + old_sigusr1 = signal(SIGUSR1, kill_child_handler); while (cont) { pid_t p = fork(); @@ -97,6 +99,7 @@ static void keepalive(void (*work)(void *data), void *data) /* child */ signal(SIGHUP, old_sighup); /* restore */ signal(SIGTERM, old_sigterm);/* restore */ + signal(SIGUSR1, old_sigusr1);/* restore */ work(data); exit(0);