X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/b9537f3be119d9a099c96bbf9329fcd5b51e5312..203e1b1f8b5ce6f7b78ed8e03b376dea2d56d0ed:/server/privsep.c diff --git a/server/privsep.c b/server/privsep.c index bbd4814a..d7063b63 100644 --- a/server/privsep.c +++ b/server/privsep.c @@ -32,6 +32,7 @@ /*----- Static variables --------------------------------------------------*/ static pid_t kid = -1; +static sig sig_chld; /*----- Fetching a tunnel file descriptor ---------------------------------*/ @@ -128,7 +129,7 @@ lose: * Use: Notices and reports child process death. */ -static void reap(int sig) +static void reap(int sig, void *p) { pid_t k; int st; @@ -185,7 +186,7 @@ void ps_split(int detachp) if (!helper) helper = PRIVSEP_HELPER; fdflags(fd[0], 0, 0, FD_CLOEXEC, FD_CLOEXEC); fdflags(fd[1], 0, 0, FD_CLOEXEC, FD_CLOEXEC); - signal(SIGCHLD, reap); + sig_add(&sig_chld, SIGCHLD, reap, 0); kid = fork(); if (kid == 0) { signal(SIGCHLD, SIG_DFL);