This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: master - qdisk: fix disk scanning check in sysfs
- From: "Fabio M. Di Nitto" <fabbione at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Fri, 15 May 2009 10:36:40 +0000 (UTC)
- Subject: 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;