summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2014-09-23 14:48:35 -0700
committerJeremy Allison <jra@samba.org>2014-09-30 20:40:16 +0200
commitfc8e1056fee9779a8bc40e7398b49bfbaa94ccd7 (patch)
tree15d6291d80ad944dcf1936a27d2cfe96a600ead0
parent16e460e180cf8d6708b27137742fbce80e29b823 (diff)
downloadsamba-fc8e1056fee9779a8bc40e7398b49bfbaa94ccd7.tar.gz
lib: util [ctdb]: 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>
-rw-r--r--ctdb/lib/util/signal.c8
-rw-r--r--ctdb/lib/util/util.h4
-rw-r--r--lib/util/samba_util.h4
-rw-r--r--lib/util/signal.c8
4 files changed, 12 insertions, 12 deletions
diff --git a/ctdb/lib/util/signal.c b/ctdb/lib/util/signal.c
index ead947eb5e6..33a9900fb40 100644
--- a/ctdb/lib/util/signal.c
+++ b/ctdb/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);
}
diff --git a/ctdb/lib/util/util.h b/ctdb/lib/util/util.h
index c7734d18474..87aaa451e72 100644
--- a/ctdb/lib/util/util.h
+++ b/ctdb/lib/util/util.h
@@ -100,12 +100,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);
/* The following definitions come from lib/util/util_str.c */
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 9da61fa4379..e9de6fae226 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -108,12 +108,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);
}