From 5f57bcc01d973516beaedfbd2c1ef552322e4779 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 20 Jul 2016 14:46:58 +1000 Subject: [PATCH] ctdb-client: Fix incorrect variable reference The point of this code is almost certainly to return non-zero when state->errormsg is set. So, return state->status if non-zero, -1 otherwise. Signed-off-by: Martin Schwenke Reviewed-by: Stefan Metzmacher --- ctdb/client/ctdb_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index 7e98499b69b..19502be1841 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -1178,7 +1178,7 @@ int ctdb_control_recv(struct ctdb_context *ctdb, state->async.fn(state); } talloc_free(tmp_ctx); - return (status == 0 ? -1 : state->status); + return (state->status == 0 ? -1 : state->status); } if (outdata) { -- 2.47.3