Origin: http://sourceforge.net/p/xymon/code/7669/
Author: Japheth Cleaver <cleaver-xymon@terabithia.org>
Description: Don't leave xymond_hostdata or xymond_history zombies
 Ensure we don't leave xymond_hostdata or xymond_history zombies lying
 around after dropping host records
Last-Update: 2015-09-10

Index: xymon/xymond/xymond_history.c
===================================================================
--- a/xymond/xymond_history.c	(revision 7668)
+++ b/xymond/xymond_history.c	(revision 7669)
@@ -178,7 +178,7 @@
 	setup_signalhandler("xymond_history");
 	memset(&sa, 0, sizeof(sa));
 	sa.sa_handler = sig_handler;
-	sigaction(SIGCHLD, &sa, NULL);
+	signal(SIGCHLD, SIG_IGN);
 	sigaction(SIGHUP, &sa, NULL);
 	signal(SIGPIPE, SIG_DFL);
 
@@ -196,9 +196,6 @@
 		int trend;
 		int childstat;
 
-		/* Pickup any finished child processes to avoid zombies */
-		while (wait3(&childstat, WNOHANG, NULL) > 0) ;
-
 		if (rotatefiles && alleventsfd) {
 			fclose(alleventsfd);
 			alleventsfd = fopen(alleventsfn, "a");
Index: xymon/xymond/xymond_hostdata.c
===================================================================
--- a/xymond/xymond_hostdata.c	(revision 7668)
+++ b/xymond/xymond_hostdata.c	(revision 7669)
@@ -132,6 +132,7 @@
 	setup_signalhandler("xymond_hostdata");
 	memset(&sa, 0, sizeof(sa));
 	sa.sa_handler = sig_handler;
+	signal(SIGCHLD, SIG_IGN);
 	sigaction(SIGHUP, &sa, NULL);
 	signal(SIGPIPE, SIG_DFL);
 
