[Cluster-devel] [PATCH 23/41] notifyd: check for pid errors and report them

Fabio M. Di Nitto fdinitto at redhat.com
Wed Nov 23 10:15:42 UTC 2011


Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
:100644 100644 133706f... 7b625c9... M	cman/notifyd/main.c
 cman/notifyd/main.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/cman/notifyd/main.c b/cman/notifyd/main.c
index 133706f..7b625c9 100644
--- a/cman/notifyd/main.c
+++ b/cman/notifyd/main.c
@@ -207,7 +207,7 @@ static void dispatch_notification(const char *str, int *quorum)
 	int envptr = 0;
 	int argvptr = 0;
 	char scratch[PATH_MAX];
-	pid_t notify_pid;
+	pid_t notify_pid, pid;
 	int pidstatus;
 	int err = 0;
 
@@ -248,7 +248,10 @@ static void dispatch_notification(const char *str, int *quorum)
 			break;
 
 		default: /* parent */
-			waitpid(notify_pid, &pidstatus, 0);
+			pid = waitpid(notify_pid, &pidstatus, 0);
+			if (pid < 0)
+				logt_print(LOG_ERR, "Error waiting for " SBINDIR "/cman_notify execution\n");
+
 			break;
 	}
 
-- 
1.7.4.4




More information about the Cluster-devel mailing list