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 qdiskd: don� deference null variable

Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
:100644 100644 929b152... 3cbac37... M cman/qdisk/daemon_init.c
cman/qdisk/daemon_init.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/cman/qdisk/daemon_init.c b/cman/qdisk/daemon_init.c
index 929b152..3cbac37 100644
--- a/cman/qdisk/daemon_init.c
+++ b/cman/qdisk/daemon_init.c
@@ -54,10 +54,9 @@ check_pid_valid(pid_t pid, char *prog)
memset(dirpath, 0, PATH_MAX);

snprintf(dirpath, sizeof (dirpath) - 1, "/proc/%d", pid);
- if ((dir = opendir(dirpath)) == NULL) {
- closedir(dir);
- return 0; /* Pid has gone away. */
- }
+ dir = opendir(dirpath);
+ if (!dir)
+ return 0; /* Pid has gone away. */
closedir(dir);

/*
--
1.7.4.4
 

Thread Tools




All times are GMT. The time now is 06:52 PM.

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