From: Jérémie Galarneau Date: Thu, 8 Jul 2021 18:39:59 +0000 (-0400) Subject: Clean-up: sessiond: return an lttng_error_code from list_triggers X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ddd915a3dd0eeb1667286051cc1e17017436fe5e;p=lttng-tools.git Clean-up: sessiond: return an lttng_error_code from list_triggers Signed-off-by: Jérémie Galarneau Change-Id: I5d44b508a2a5211894c0cc7b6d51a9a03dc8b3f2 --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 7715e1452..284f2921b 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4631,11 +4631,10 @@ end: return ret_code; } -int cmd_list_triggers(struct command_ctx *cmd_ctx, +enum lttng_error_code cmd_list_triggers(struct command_ctx *cmd_ctx, struct notification_thread_handle *notification_thread, struct lttng_triggers **return_triggers) { - int ret = 0; enum lttng_error_code ret_code; struct lttng_triggers *triggers = NULL; @@ -4643,16 +4642,15 @@ int cmd_list_triggers(struct command_ctx *cmd_ctx, ret_code = notification_thread_command_list_triggers( notification_thread, cmd_ctx->creds.uid, &triggers); if (ret_code != LTTNG_OK) { - ret = ret_code; goto end; } *return_triggers = triggers; triggers = NULL; - ret = LTTNG_OK; + ret_code = LTTNG_OK; end: lttng_triggers_destroy(triggers); - return ret; + return ret_code; } enum lttng_error_code cmd_execute_error_query(const struct lttng_credentials *cmd_creds, diff --git a/src/bin/lttng-sessiond/cmd.h b/src/bin/lttng-sessiond/cmd.h index 33cac66ff..03f7cc1a4 100644 --- a/src/bin/lttng-sessiond/cmd.h +++ b/src/bin/lttng-sessiond/cmd.h @@ -152,7 +152,7 @@ enum lttng_error_code cmd_unregister_trigger( const struct lttng_trigger *trigger, struct notification_thread_handle *notification_thread_handle); -int cmd_list_triggers(struct command_ctx *cmd_ctx, +enum lttng_error_code cmd_list_triggers(struct command_ctx *cmd_ctx, struct notification_thread_handle *notification_thread_handle, struct lttng_triggers **return_triggers); enum lttng_error_code cmd_execute_error_query(const struct lttng_credentials *cmd_creds,