Otherwise callers can't tell the difference between some other failure
(e.g. memory allocation failure) and an unknown tunable.
Signed-off-by: Martin Schwenke <martin@meltin.net>
talloc_free(data.dptr);
if (ret != 0 || res != 0) {
DEBUG(DEBUG_ERR,(__location__ " ctdb_control for get_tunable failed\n"));
- return -1;
+ return ret != 0 ? ret : res;
}
if (outdata.dsize != sizeof(uint32_t)) {
talloc_free(name);
if (i == ARRAY_SIZE(tunable_map)) {
- return -1;
+ return -EINVAL;
}
val = *(uint32_t *)(tunable_map[i].offset + (uint8_t*)&ctdb->tunable);
name = argv[0];
ret = ctdb_ctrl_get_tunable(ctdb, TIMELIMIT(), options.pnn, name, &value);
- if (ret == -1) {
+ if (ret != 0) {
DEBUG(DEBUG_ERR, ("Unable to get tunable variable '%s'\n", name));
return -1;
}