From 4b990eff03f91b7d076b0a570f709f0037e06fb9 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 28 Sep 1996 21:43:07 +0000 Subject: [PATCH] new childhandler git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@779 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/kx/kxd.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/appl/kx/kxd.c b/appl/kx/kxd.c index be2085172..f524c4d94 100644 --- a/appl/kx/kxd.c +++ b/appl/kx/kxd.c @@ -11,6 +11,23 @@ static size_t cookie_len; #define COOKIE_TYPE "MIT-MAGIC-COOKIE-1" +/* + * Signal handler that justs waits for the children when they die. + */ + +static RETSIGTYPE +childhandler (int sig) +{ + pid_t pid; + int status; + + do { + pid = waitpid (-1, &status, WNOHANG|WUNTRACED); + } while(pid > 0); + signal (SIGCHLD, childhandler); + SIGRETURN(0); +} + static int fatal (int fd, char *s) {