public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: master - cman: allow getnameinfo() to fail.
@ 2009-01-29 12:05 Christine Caulfield
0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2009-01-29 12:05 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4ec60b52bca8f5d44ad35b8ad3754fc6e2463d3c
Commit: 4ec60b52bca8f5d44ad35b8ad3754fc6e2463d3c
Parent: 7f61677ad6cf43bca6ec13ed41aa765cac280205
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Thu Jan 29 12:04:46 2009 +0000
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Thu Jan 29 12:04:46 2009 +0000
cman: allow getnameinfo() to fail.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
cman/services/cman/lib/libcman.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/cman/services/cman/lib/libcman.c b/cman/services/cman/lib/libcman.c
index beb1091..22c51f8 100644
--- a/cman/services/cman/lib/libcman.c
+++ b/cman/services/cman/lib/libcman.c
@@ -1015,6 +1015,7 @@ int cman_get_nodes(cman_handle_t handle, int maxnodes, int *retnodes, cman_node_
int max_addrs = 4;
corosync_cfg_node_address_t addrs[max_addrs];
int num_addrs;
+ char *name = NULL;
int error;
if (!cman_inst->cfg_handle) {
@@ -1029,11 +1030,13 @@ int cman_get_nodes(cman_handle_t handle, int maxnodes, int *retnodes, cman_node_
nodes[i].cn_member = 1;
error = corosync_cfg_get_node_addrs(cman_inst->cfg_handle, nodes[i].cn_nodeid, max_addrs, &num_addrs, addrs);
- if (error) {
- sprintf(nodes[i].cn_name, "Node-%x", nodes[i].cn_nodeid);
+ if (!error)
+ name = node_name(&addrs[0]);
+ if (name) {
+ sprintf(nodes[i].cn_name, "%s", name);
}
else {
- sprintf(nodes[i].cn_name, "%s", node_name(&addrs[0]));
+ sprintf(nodes[i].cn_name, "Node-%x", nodes[i].cn_nodeid);
}
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-29 12:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-29 12:05 cluster: master - cman: allow getnameinfo() to fail Christine Caulfield
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).