diff --git a/appl/kx/kx.c b/appl/kx/kx.c index 8ab64634d..435eea40e 100644 --- a/appl/kx/kx.c +++ b/appl/kx/kx.c @@ -43,6 +43,21 @@ usr1handler (int sig) SIGRETURN(0); } +/* + * Almost the same as for SIGUSR1, except we should exit immediately + * if there are no active children. + */ + +static RETSIGTYPE +usr2handler (int sig) +{ + donep = 1; + if (nchild == 0) + exit (0); + + SIGRETURN(0); +} + /* * Establish authenticated connection */ @@ -398,5 +413,6 @@ main(int argc, char **argv) passivep = 1; signal (SIGCHLD, childhandler); signal (SIGUSR1, usr1handler); + signal (SIGUSR2, usr2handler); return doit (argv[0], passivep, debugp); }