From: Mark Wooding Date: Tue, 13 Mar 2012 02:30:57 +0000 (+0000) Subject: server/privsep.c: Bring SIGCHLD handler in-line. X-Git-Tag: 1.0.0pre11~40 X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/commitdiff_plain/e533c005b62f3e1016b5fb9a3b6973124480a54b server/privsep.c: Bring SIGCHLD handler in-line. --- 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);