1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ctdb-tool: Exit with 1 on failure instead of -1

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2016-07-22 17:08:25 +10:00 committed by Amitay Isaacs
parent 02709c7aaa
commit fc7968dbea
4 changed files with 11 additions and 5 deletions

View File

@ -12,7 +12,7 @@ EOF
rm -f "$CTDB_NODES"
required_result 255 <<EOF
required_result 1 <<EOF
${TEST_DATE_STAMP}Failed to read nodes file "${CTDB_NODES}"
EOF

View File

@ -23,7 +23,7 @@ NODEMAP
2 192.168.20.43 0x0
EOF
required_result 255 <<EOF
required_result 1 <<EOF
ERROR: Node file on node 1 differs from current node (0)
EOF

View File

@ -25,7 +25,7 @@ NODEMAP
2 192.168.20.43 0x0
EOF
required_result 255 <<EOF
required_result 1 <<EOF
ctdb_control error: 'Failed to read nodes file'
ctdb_control error: 'Failed to read nodes file'
ERROR: Failed to get nodes file from node 1

View File

@ -5886,7 +5886,11 @@ int main(int argc, const char *argv[])
DEBUG(DEBUG_ERR, ("Can't specify node(s) with \"ctdb %s\"\n", control));
exit(1);
}
return ctdb_commands[i].fn(NULL, extra_argc-1, extra_argv+1);
ret = ctdb_commands[i].fn(NULL, extra_argc-1, extra_argv+1);
if (ret == -1) {
ret = 1;
}
return ret;
}
/* initialise ctdb */
@ -5932,6 +5936,8 @@ int main(int argc, const char *argv[])
talloc_free(ev);
(void)poptFreeContext(pc);
if (ret == -1) {
ret = 1;
}
return ret;
}