From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1463 invoked by alias); 5 Feb 2009 11:27:17 -0000 Received: (qmail 1457 invoked by alias); 5 Feb 2009 11:27:16 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com Subject: cluster: STABLE3 - cman: Print nodeids as unsigned ints To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: 34fe18a15b5147c4444510e0eddc80a5ce16a11e X-Git-Newrev: 895786b6d42aa5d980f06625a96e0dea47d25ad1 From: Christine Caulfield Message-Id: <20090205112652.182A31205B9@lists.fedorahosted.org> Date: Thu, 05 Feb 2009 11:27:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00387.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=895786b6d42aa5d980f06625a96e0dea47d25ad1 Commit: 895786b6d42aa5d980f06625a96e0dea47d25ad1 Parent: 34fe18a15b5147c4444510e0eddc80a5ce16a11e Author: Christine Caulfield AuthorDate: Thu Feb 5 11:26:05 2009 +0000 Committer: Christine Caulfield CommitterDate: Thu Feb 5 11:26:05 2009 +0000 cman: Print nodeids as unsigned ints Signed-off-by: Christine Caulfield --- cman/cman_tool/main.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cman/cman_tool/main.c b/cman/cman_tool/main.c index 87e52d3..50a8f05 100644 --- a/cman/cman_tool/main.c +++ b/cman/cman_tool/main.c @@ -256,7 +256,7 @@ static void show_status(void) node.cn_name[0] = 0; if (cman_get_node(h, CMAN_NODEID_US, &node) == 0) { printf("Node name: %s\n", node.cn_name); - printf("Node ID: %d\n", node.cn_nodeid); + printf("Node ID: %u\n", node.cn_nodeid); } printf("Multicast addresses: "); @@ -348,7 +348,7 @@ static void print_node(commandline_t *comline, cman_handle_t h, int *format, str struct cman_node_address addrs[MAX_INTERFACES]; char jstring[1024]; int i,j,k; - int tmpid; + unsigned int tmpid; cman_node_extra_t enode; if (comline->num_nodenames > 0) { @@ -375,7 +375,7 @@ static void print_node(commandline_t *comline, cman_handle_t h, int *format, str /* Make the name more friendly if cman can't find it in cluster.conf * (we really don't want corosync to look up names in DNS so it invents them) */ - if (sscanf(node->cn_name, "Node%d", &tmpid) == 1 && tmpid == node->cn_nodeid) { + if (sscanf(node->cn_name, "Node%u", &tmpid) == 1 && tmpid == node->cn_nodeid) { if (!cman_get_node_addrs(h, node->cn_nodeid, MAX_INTERFACES, &numaddrs, addrs) && numaddrs) { getnameinfo((struct sockaddr *)addrs[0].cna_address, addrs[0].cna_addrlen, node->cn_name, sizeof(node->cn_name), NULL, 0, NI_NAMEREQD); } @@ -388,7 +388,7 @@ static void print_node(commandline_t *comline, cman_handle_t h, int *format, str strcpy(jstring, " "); if (!comline->format_opts) { - printf("%4d %c %5d %s %s\n", + printf("%4u %c %5d %s %s\n", node->cn_nodeid, member_type, node->cn_incarnation, jstring, node->cn_name); } @@ -433,7 +433,7 @@ static void print_node(commandline_t *comline, cman_handle_t h, int *format, str case FMT_NONE: break; case FMT_ID: - printf("%d ", node->cn_nodeid); + printf("%u ", node->cn_nodeid); break; case FMT_NAME: printf("%s ", node->cn_name);