diff options
author | Jeremy Allison <jra@samba.org> | 2014-10-09 13:41:05 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2014-10-19 21:05:07 +0200 |
commit | 78deb22b08eaf70beada870107f9a07ab9142999 (patch) | |
tree | e86b77b5640286f779c3857f259eaf8dd8dd0764 /lib | |
parent | 429ddb19e7b36e535b9c59664999d52bee99806f (diff) | |
download | samba-78deb22b08eaf70beada870107f9a07ab9142999.tar.gz |
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 <jra@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util/samba_util.h | 4 | ||||
-rw-r--r-- | lib/util/signal.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h index f4216d81b3..c6eb3496b9 100644 --- a/lib/util/samba_util.h +++ b/lib/util/samba_util.h @@ -107,12 +107,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 ead947eb5e..33a9900fb4 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); } |