public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Christine Caulfield <chrissie@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE3 - cman: Tidy the shutdown code.
Date: Wed, 05 Aug 2009 13:05:00 -0000	[thread overview]
Message-ID: <20090805130511.6F656120197@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a0b7e5fc2d35021b5617cece6b959859efdfaba6
Commit:        a0b7e5fc2d35021b5617cece6b959859efdfaba6
Parent:        212f926220e45c0366ba23dc4bb9e5306fcc21ad
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Aug 5 14:04:41 2009 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Aug 5 14:04:41 2009 +0100

cman: Tidy the shutdown code.

Remove some duplicate code

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 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)


                 reply	other threads:[~2009-08-05 13:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090805130511.6F656120197@lists.fedorahosted.org \
    --to=chrissie@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).