cfgtool: Use CS_PRI_NODE_ID for formatting nodeid

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
This commit is contained in:
Jan Friesse 2021-08-02 11:24:57 +02:00
parent 2856a6d85e
commit 49999d0692
2 changed files with 3 additions and 2 deletions

View File

@ -57,6 +57,7 @@ typedef int64_t cs_time_t;
#define CS_MAX(x, y) (((x) > (y)) ? (x) : (y))
#define CS_PRI_NODE_ID "%" PRIu32
#define CS_PRI_NODE_ID_PADDED "%10" PRIu32
#define CS_PRI_RING_ID_SEQ "%" PRIx64
#define CS_PRI_RING_ID "%" PRIx32 ".%" PRIx64
/**

View File

@ -240,7 +240,7 @@ nodestatusget_do (enum user_action action, int brief)
if (result == CS_OK) {
/* Only display node info if it is reachable (and not us) */
if (node_status.reachable && node_status.nodeid != local_nodeid) {
printf("nodeid: %d", node_status.nodeid);
printf("nodeid: " CS_PRI_NODE_ID "", node_status.nodeid);
printf(" reachable");
if (node_status.remote) {
printf(" remote");
@ -311,7 +311,7 @@ nodestatusget_do (enum user_action action, int brief)
} else {
printf("\tstatus:\n");
for (j=0; j<s; j++) {
printf("\t\tnodeid: %3d:\t", node_info[j].nodeid);
printf("\t\tnodeid: " CS_PRI_NODE_ID_PADDED ":\t", node_info[j].nodeid);
if (j == local_nodeid_index) {
printf("localhost");
} else {