From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13282 invoked by alias); 5 Aug 2009 13:05:36 -0000 Received: (qmail 13268 invoked by alias); 5 Aug 2009 13:05:34 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.9 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: STABLE3 - cman: Tidy the shutdown code. To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: 212f926220e45c0366ba23dc4bb9e5306fcc21ad X-Git-Newrev: a0b7e5fc2d35021b5617cece6b959859efdfaba6 From: Christine Caulfield Message-Id: <20090805130511.6F656120197@lists.fedorahosted.org> Date: Wed, 05 Aug 2009 13:05: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-q3/txt/msg00159.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a0b7e5fc2d35021b5617cece6b959859efdfaba6 Commit: a0b7e5fc2d35021b5617cece6b959859efdfaba6 Parent: 212f926220e45c0366ba23dc4bb9e5306fcc21ad Author: Christine Caulfield AuthorDate: Wed Aug 5 14:04:41 2009 +0100 Committer: Christine Caulfield CommitterDate: Wed Aug 5 14:04:41 2009 +0100 cman: Tidy the shutdown code. Remove some duplicate code Signed-off-by: Christine Caulfield --- cman/daemon/commands.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index b7f7293..f31f47d 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -993,7 +993,8 @@ static void check_shutdown_status(void) /* All replies safely gathered in ? */ if (shutdown_yes + shutdown_no >= shutdown_expected) { - corosync->timer_delete(shutdown_timer); + if (shutdown_timer) + corosync->timer_delete(shutdown_timer); if (shutdown_yes >= shutdown_expected || shutdown_flags & SHUTDOWN_ANYWAY) { @@ -1071,14 +1072,8 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf) /* If no-one is listening for events then we can just go down now */ if (shutdown_expected == 0) { - int leaveflags = CLUSTER_LEAVEFLAG_DOWN; - - quit_threads = 1; - if (shutdown_flags & SHUTDOWN_REMOVE) - leaveflags |= CLUSTER_LEAVEFLAG_REMOVED; - - send_leave(leaveflags); - return 0; + shutdown_timer = 0; + check_shutdown_status(); } else { @@ -1091,6 +1086,7 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf) return -EWOULDBLOCK; } + return 0; } static int do_cmd_register_quorum_device(char *cmdbuf, int *retlen)