From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9453 invoked by alias); 19 May 2009 20:01:59 -0000 Received: (qmail 9234 invoked by alias); 19 May 2009 20:01:59 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: RHEL5 - qdisk: fix disk scanning check in sysfs To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: d727e39ecd607b879ec3dc8841d599131ee7638d X-Git-Newrev: 7ef5811c939381771d2c144e284c801b5445c909 From: Lon Hohberger Message-Id: <20090519200130.7331F120152@lists.fedorahosted.org> Date: Tue, 19 May 2009 20:01:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00337.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7ef5811c939381771d2c144e284c801b5445c909 Commit: 7ef5811c939381771d2c144e284c801b5445c909 Parent: d727e39ecd607b879ec3dc8841d599131ee7638d Author: Fabio M. Di Nitto AuthorDate: Fri May 15 12:33:27 2009 +0200 Committer: Lon Hohberger CommitterDate: Tue May 19 16:01:12 2009 -0400 qdisk: fix disk scanning check in sysfs check for correct return code Signed-off-by: Fabio M. Di Nitto Signed-off-by: Lon Hohberger --- 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 9ff4bf6..576ed3f 100644 --- a/cman/qdisk/scandisk.c +++ b/cman/qdisk/scandisk.c @@ -589,15 +589,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;