public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - fenced: cpg_finalize
@ 2009-02-27 17:59 David Teigland
0 siblings, 0 replies; only message in thread
From: David Teigland @ 2009-02-27 17:59 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4ca347ec2e9ecb3e418876e60e6db834aa0be668
Commit: 4ca347ec2e9ecb3e418876e60e6db834aa0be668
Parent: 7e273f6f977c546ec7cc997be54ec138e29635f3
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:54:32 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 ead60dd..0218006 100644
--- a/fence/fenced/cpg.c
+++ b/fence/fenced/cpg.c
@@ -1826,7 +1826,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);
@@ -1853,17 +1853,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");
@@ -1879,6 +1883,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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-27 17:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-27 17:59 cluster: STABLE3 - fenced: cpg_finalize David Teigland
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).