From f100dcfa9a26cae97c6b921e5c9992df1a056edd Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 20 Jul 2020 22:13:48 +0200 Subject: [PATCH] occtl: corrected error code on failed commands Signed-off-by: Nikos Mavrogiannopoulos --- src/occtl/unix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/occtl/unix.c b/src/occtl/unix.c index 6bf17eb0..9d42f493 100644 --- a/src/occtl/unix.c +++ b/src/occtl/unix.c @@ -483,11 +483,12 @@ int handle_unban_ip_cmd(struct unix_ctx *ctx, const char *arg, cmd_params_st *pa if (status != 0) { printf("IP '%s' was unbanned\n", arg); + ret = 0; } else { printf("could not unban IP '%s'\n", arg); + ret = 1; } - ret = 0; goto cleanup; error: @@ -533,11 +534,12 @@ int handle_disconnect_user_cmd(struct unix_ctx *ctx, const char *arg, cmd_params if (status != 0) { printf("user '%s' was disconnected\n", arg); + ret = 0; } else { printf("could not disconnect user '%s'\n", arg); + ret = 1; } - ret = 0; goto cleanup; error: