lib: util [ctdb]: Signal handling - change CatchChild() and CatchChildLeaveStatus...
authorJeremy Allison <jra@samba.org>
Tue, 23 Sep 2014 21:48:35 +0000 (14:48 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 30 Sep 2014 18:40:16 +0000 (20:40 +0200)
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>
ctdb/lib/util/signal.c
ctdb/lib/util/util.h
lib/util/samba_util.h
lib/util/signal.c

index ead947eb5e63332015774a8265942aa995f65dbf..33a9900fb40019fee0eb665e9b4cbd1bbfe5bf9e 100644 (file)
@@ -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);
 }
index c7734d184742c1618c0228b4d99ad54c402eb50a..87aaa451e721aa2e777737b1a6ca12fd3733f32f 100644 (file)
@@ -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  */
index 9da61fa437933fc0bc8becd2916b6125287cae8f..e9de6fae226de9c4a2d7b76cd9cca375b5b98e90 100644 (file)
@@ -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;
 
index ead947eb5e63332015774a8265942aa995f65dbf..33a9900fb40019fee0eb665e9b4cbd1bbfe5bf9e 100644 (file)
@@ -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);
 }