From c6bbf229a6da26b8fa64faf30db747ee9d10bd7f Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Mon, 30 Sep 1996 05:14:25 +0000 Subject: [PATCH] Now using SIGUSR1 to mean `exit when number of children goes down to zero'. SIGUSR2 is `exit when number of children is equal to zero'. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@813 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/kx/kx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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); }