From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18695 invoked by alias); 27 Mar 2009 17:57:22 -0000 Received: (qmail 18689 invoked by alias); 27 Mar 2009 17:57:21 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63,SPF_HELO_PASS X-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion.fedora.phx.redhat.com Subject: dlm: master - dlm_tool: ls failure should exit with failure To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: dlm.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: d412e873107000491b0a2c77bb4f6b52b523772c X-Git-Newrev: 9ece1eee48182537cf54f20ee54bece54cfd64dc From: David Teigland Message-Id: <20090327175702.373EE12020C@lists.fedorahosted.org> Date: Fri, 27 Mar 2009 17:57: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-q1/txt/msg00934.txt.bz2 Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=9ece1eee48182537cf54f20ee54bece54cfd64dc Commit: 9ece1eee48182537cf54f20ee54bece54cfd64dc Parent: d412e873107000491b0a2c77bb4f6b52b523772c Author: David Teigland AuthorDate: Fri Mar 27 11:35:26 2009 -0500 Committer: David Teigland CommitterDate: Fri Mar 27 12:52:52 2009 -0500 dlm_tool: ls failure should exit with failure exit code of list command can be used to check if dlm_controld is running Signed-off-by: David Teigland --- dlm/tool/main.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dlm/tool/main.c b/dlm/tool/main.c index c247044..631fb56 100644 --- a/dlm/tool/main.c +++ b/dlm/tool/main.c @@ -1182,16 +1182,15 @@ static void do_list(char *name) memset(lss, 0, sizeof(lss)); if (name) { - rv = dlmc_lockspace_info(name, lss); - if (rv < 0) - return; ls_count = 1; + rv = dlmc_lockspace_info(name, lss); } else { rv = dlmc_lockspaces(MAX_LS, &ls_count, lss); - if (rv < 0) - return; } + if (rv < 0) + exit(EXIT_FAILURE); /* dlm_controld probably not running */ + if (ls_count) printf("dlm lockspaces\n");