summaryrefslogtreecommitdiffstats
path: root/ctdb/tools
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-09-18 13:40:52 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-10-04 15:15:35 +1000
commit7a3e2f1627584c0673a0ddda4061017525f8fcb8 (patch)
tree2420d372d9a6f88a2dc53b51ceab794eb4e46bdd /ctdb/tools
parentb527236efea0f5f40ab9cfe23d244aa6a8060173 (diff)
downloadsamba-7a3e2f1627584c0673a0ddda4061017525f8fcb8.tar.gz
samba-7a3e2f1627584c0673a0ddda4061017525f8fcb8.tar.xz
samba-7a3e2f1627584c0673a0ddda4061017525f8fcb8.zip
tools/ctdb: Stop return value from being clobbered in control_lvsmaster()
ret is initialised too early and is clobbered by the call to ctdb_ctrl_getcapabilities(). Initialising it later means that the function returns -1 when no LVS master is found. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 3296559c43e70f755fcf2c06677891e0319c8142)
Diffstat (limited to 'ctdb/tools')
-rw-r--r--ctdb/tools/ctdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 55290681684..727d38e051f 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -3538,8 +3538,6 @@ static int control_lvsmaster(struct ctdb_context *ctdb, int argc, const char **a
CTDB_NO_MEMORY(ctdb, capabilities);
}
- ret = -1;
-
/* collect capabilities for all connected nodes */
for (i=0; i<nodemap->num; i++) {
if (nodemap->nodes[i].flags & NODE_FLAGS_INACTIVE) {
@@ -3565,6 +3563,8 @@ static int control_lvsmaster(struct ctdb_context *ctdb, int argc, const char **a
}
}
+ ret = -1;
+
/* find and show the lvsmaster */
for (i=0; i<nodemap->num; i++) {
if (nodemap->nodes[i].flags & NODE_FLAGS_INACTIVE) {