client: Return a value of 1 when setting obsolete tunable variable
authorMartin Schwenke <martin@meltin.net>
Sun, 8 Feb 2015 23:32:47 +0000 (10:32 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 26 Feb 2015 00:54:59 +0000 (11:54 +1100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(Imported from commit 54f0c39e5a33871847aa9fe2c070c7f638f54cc4)

client/ctdb_client.c
server/ctdb_tunables.c

index 45531137b167d33863559c27324856460410312f..cf6835a92d092ffc74700231de4d12f668a9663b 100644 (file)
@@ -2735,12 +2735,12 @@ int ctdb_ctrl_set_tunable(struct ctdb_context *ctdb,
        ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_SET_TUNABLE, 0, data, NULL,
                           NULL, &res, &timeout, NULL);
        talloc_free(data.dptr);
-       if (ret != 0 || res != 0) {
+       if ((ret != 0) || (res == -1)) {
                DEBUG(DEBUG_ERR,(__location__ " ctdb_control for set_tunable failed\n"));
                return -1;
        }
 
-       return 0;
+       return res;
 }
 
 /*
index 544a9e0397c01da916517a455fc64a47688ff014..e5ccf106a1862936dec55d494d589fa4c211d7ac 100644 (file)
@@ -175,6 +175,7 @@ int32_t ctdb_control_set_tunable(struct ctdb_context *ctdb, TDB_DATA indata)
                DEBUG(DEBUG_WARNING,
                      ("Setting obsolete tunable \"%s\"\n",
                       tunable_map[i].name));
+               return 1;
        }
 
        return 0;