FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 11-23-2011, 09:15 AM
"Fabio M. Di Nitto"
 
Default notifyd: check for pid errors and report them

Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@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
");
+
break;
}

--
1.7.4.4
 

Thread Tools




All times are GMT. The time now is 02:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org