This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
master - cman notify: wait for forked process to terminate..
- From: "Fabio M. Di Nitto" <fabbione at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Tue, 4 Nov 2008 08:42:26 +0000 (UTC)
- Subject: master - cman notify: wait for forked process to terminate..
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=83114068b1cada01c63015ddfa5401938c8500b1
Commit: 83114068b1cada01c63015ddfa5401938c8500b1
Parent: cd9f377363c38502b857527209d1531412125987
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Tue Nov 4 09:41:50 2008 +0100
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Tue Nov 4 09:41:50 2008 +0100
cman notify: wait for forked process to terminate..
.. and leave zombies around the system..
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
cman/notifyd/main.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/cman/notifyd/main.c b/cman/notifyd/main.c
index 2522b4a..870e2df 100644
--- a/cman/notifyd/main.c
+++ b/cman/notifyd/main.c
@@ -8,6 +8,8 @@
#include <errno.h>
#include <limits.h>
#include <sched.h>
+#include <sys/types.h>
+#include <sys/wait.h>
#include <libcman.h>
#include <ccs.h>
@@ -206,7 +208,8 @@ static void dispatch_notification(char *str)
int envptr = 0;
int argvptr = 0;
char scratch[PATH_MAX];
- int notify_pid;
+ pid_t notify_pid;
+ int pidstatus;
if (!str)
return;
@@ -238,6 +241,7 @@ static void dispatch_notification(char *str)
break;
default: /* parent */
+ waitpid(notify_pid, &pidstatus, 0);
break;
}