This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fence: master - fenced: cpg_finalize


Gitweb:        http://git.fedorahosted.org/git/fence.git?p=fence.git;a=commitdiff;h=2b4a47e98ce67ef25f875dc50d7334b3edad6b4d
Commit:        2b4a47e98ce67ef25f875dc50d7334b3edad6b4d
Parent:        b02e6f79dc39dd3cc7cb6beb75d9a47f259af7ea
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Fri Feb 27 11:54:32 2009 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Feb 27 11:56:44 2009 -0600

fenced: cpg_finalize

Call cpg_finalize on all our cpg handles when shutting down.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 fence/fenced/cpg.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/fence/fenced/cpg.c b/fence/fenced/cpg.c
index dc9e54c..05db9b0 100644
--- a/fence/fenced/cpg.c
+++ b/fence/fenced/cpg.c
@@ -1828,7 +1828,7 @@ int setup_cpg(void)
 	error = cpg_initialize(&cpg_handle_daemon, &cpg_callbacks_daemon);
 	if (error != CPG_OK) {
 		log_error("daemon cpg_initialize error %d", error);
-		goto fail;
+		goto ret;
 	}
 
 	cpg_fd_get(cpg_handle_daemon, &daemon_cpg_fd);
@@ -1855,17 +1855,21 @@ int setup_cpg(void)
 
  fail:
 	cpg_finalize(cpg_handle_daemon);
+ ret:
 	return -1;
 }
 
 void close_cpg(void)
 {
+	struct fd *fd;
 	cpg_error_t error;
 	struct cpg_name name;
 	int i = 0;
 
-	if (!cpg_handle_daemon || cluster_down)
+	if (!cpg_handle_daemon)
 		return;
+	if (cluster_down)
+		goto fin;
 
 	memset(&name, 0, sizeof(name));
 	sprintf(name.value, "fenced:daemon");
@@ -1881,6 +1885,12 @@ void close_cpg(void)
 	}
 	if (error != CPG_OK)
 		log_error("daemon cpg_leave error %d", error);
+ fin:
+	list_for_each_entry(fd, &domains, list) {
+		if (fd->cpg_handle)
+			cpg_finalize(fd->cpg_handle);
+	}
+	cpg_finalize(cpg_handle_daemon);
 }
 
 int set_node_info(struct fd *fd, int nodeid, struct fenced_node *nodeinfo)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]