diff options
author | Martin Schwenke <martin@meltin.net> | 2019-05-24 13:50:07 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2019-06-05 10:25:49 +0000 |
commit | 865f127e7d29829da6c638ba13a034071ef14a6b (patch) | |
tree | dd09a487d86b698ebb71bdf901a37c12b7380b6e /ctdb/tools | |
parent | 2558f96da1f9be8034f26736c8050bb38a1f82a8 (diff) | |
download | samba-865f127e7d29829da6c638ba13a034071ef14a6b.tar.gz |
ctdb-tools: Fix signed/unsigned comparisons by declaring extra variable
This needs an extra variable because variable i has been used in both
signed and unsigned contexts.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tools')
-rw-r--r-- | ctdb/tools/ctdb.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 84333ed1d49..38f9e5e1781 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -2363,6 +2363,7 @@ static int control_detach(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, uint8_t db_flags; struct ctdb_node_map *nodemap; int recmode; + unsigned int j; int ret, ret2, i; if (argc < 1) { @@ -2386,29 +2387,29 @@ static int control_detach(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, return 1; } - for (i=0; i<nodemap->num; i++) { + for (j=0; j<nodemap->num; j++) { uint32_t value; - if (nodemap->node[i].flags & NODE_FLAGS_DISCONNECTED) { + if (nodemap->node[j].flags & NODE_FLAGS_DISCONNECTED) { continue; } - if (nodemap->node[i].flags & NODE_FLAGS_DELETED) { + if (nodemap->node[j].flags & NODE_FLAGS_DELETED) { continue; } - if (nodemap->node[i].flags & NODE_FLAGS_INACTIVE) { + if (nodemap->node[j].flags & NODE_FLAGS_INACTIVE) { fprintf(stderr, "Database cannot be detached on" " inactive (stopped or banned) node %u\n", - nodemap->node[i].pnn); + nodemap->node[j].pnn); return 1; } ret = ctdb_ctrl_get_tunable(mem_ctx, ctdb->ev, ctdb->client, - nodemap->node[i].pnn, TIMEOUT(), + nodemap->node[j].pnn, TIMEOUT(), "AllowClientDBAttach", &value); if (ret != 0) { fprintf(stderr, "Unable to get tunable AllowClientDBAttach" - " from node %u\n", nodemap->node[i].pnn); + " from node %u\n", nodemap->node[j].pnn); return ret; } @@ -2416,7 +2417,7 @@ static int control_detach(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, fprintf(stderr, "Database access is still active on node %u." " Set AllowclientDBAttach=0 on all nodes.\n", - nodemap->node[i].pnn); + nodemap->node[j].pnn); return 1; } } |