Regression introduced by commit
2558f96da1f9be8034f26736c8050bb38a1f82a8. count should be signed
because list_of_connected_nodes() returns -1 on failure. Variable i
is used in both signed and unsigned contexts, so add new signed
variable j for use in signed context.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
struct ctdb_req_control request;
struct ctdb_reply_control **reply;
bool reload;
- unsigned int i, count;
+ unsigned int i;
+ int count;
int ret;
uint32_t *pnn_list;
&request, NULL, &reply);
if (ret != 0) {
bool failed = false;
+ int j;
- for (i=0; i<count; i++) {
- ret = ctdb_reply_control_reload_nodes_file(reply[i]);
+ for (j=0; j<count; j++) {
+ ret = ctdb_reply_control_reload_nodes_file(reply[j]);
if (ret != 0) {
fprintf(stderr,
"Node %u failed to reload nodes\n",
- pnn_list[i]);
+ pnn_list[j]);
failed = true;
}
}