occtl: corrected error code on failed commands

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2020-07-20 22:13:48 +02:00
parent e677c8b536
commit f100dcfa9a

View File

@@ -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: