From: Jeremy Allison Date: Thu, 9 Oct 2014 20:41:05 +0000 (-0700) Subject: lib: util: Signal handling - change CatchChild() and CatchChildLeaveStatus() to retur... X-Git-Tag: samba-4.0.23~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dda86f32c9f1ad5c906a85596d062149693235e;p=thirdparty%2Fsamba.git lib: util: Signal handling - change CatchChild() and CatchChildLeaveStatus() to return the previous handler. Bug #10831 - SIGCLD Signal handler not correctly reinstalled on old library code use - smbrun etc. https://bugzilla.samba.org/show_bug.cgi?id=10831 Signed-off-by: Jeremy Allison Reviewed-by: Martin Schwenke --- diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h index c061721e651..3c1874f54e1 100644 --- a/lib/util/samba_util.h +++ b/lib/util/samba_util.h @@ -104,12 +104,12 @@ void (*CatchSignal(int signum,void (*handler)(int )))(int); /** Ignore SIGCLD via whatever means is necessary for this OS. **/ -void CatchChild(void); +void (*CatchChild(void))(int); /** Catch SIGCLD but leave the child around so it's status can be reaped. **/ -void CatchChildLeaveStatus(void); +void (*CatchChildLeaveStatus(void))(int); struct sockaddr; diff --git a/lib/util/signal.c b/lib/util/signal.c index ead947eb5e6..33a9900fb40 100644 --- a/lib/util/signal.c +++ b/lib/util/signal.c @@ -129,16 +129,16 @@ void (*CatchSignal(int signum,void (*handler)(int )))(int) Ignore SIGCLD via whatever means is necessary for this OS. **/ -void CatchChild(void) +void (*CatchChild(void))(int) { - CatchSignal(SIGCLD, sig_cld); + return CatchSignal(SIGCLD, sig_cld); } /** Catch SIGCLD but leave the child around so it's status can be reaped. **/ -void CatchChildLeaveStatus(void) +void (*CatchChildLeaveStatus(void))(int) { - CatchSignal(SIGCLD, sig_cld_leave_status); + return CatchSignal(SIGCLD, sig_cld_leave_status); }