This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: master - qdisk: fix disk scanning check in sysfs


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9fafcadd76709f24b86e8888e6987b6edebac265
Commit:        9fafcadd76709f24b86e8888e6987b6edebac265
Parent:        72d3438fe92326b28981be3d978585591efd65ae
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Fri May 15 12:33:27 2009 +0200
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Fri May 15 12:36:26 2009 +0200

qdisk: fix disk scanning check in sysfs

check for correct return code

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 cman/qdisk/scandisk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cman/qdisk/scandisk.c b/cman/qdisk/scandisk.c
index 1eaa75e..0b1688f 100644
--- a/cman/qdisk/scandisk.c
+++ b/cman/qdisk/scandisk.c
@@ -574,15 +574,15 @@ static int sysfs_is_disk(char *path)
 		goto found;
 
 	snprintf(newpath, sizeof(newpath), "%s/../device/media", path);
-	if (lstat(newpath, &sb))
+	if (!lstat(newpath, &sb))
 		goto found;
 
 	snprintf(newpath, sizeof(newpath), "%s/device/devtype", path);
-	if (lstat(newpath, &sb))
+	if (!lstat(newpath, &sb))
 		return 1;
 
 	snprintf(newpath, sizeof(newpath), "%s/../device/devtype", path);
-	if (lstat(newpath, &sb))
+	if (!lstat(newpath, &sb))
 		return 1;
 
 	return -1;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]