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: master - cman: allow getnameinfo() to fail. Date: Thu, 29 Jan 2009 12:05:00 -0000 [thread overview] Message-ID: <20090129120510.967A9120569@lists.fedorahosted.org> (raw) 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); } } }
reply other threads:[~2009-01-29 12: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=20090129120510.967A9120569@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: linkBe 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).