Clean-up: sessiond: return an lttng_error_code from list_triggers
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 8 Jul 2021 18:39:59 +0000 (14:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 12 Jul 2021 21:37:18 +0000 (17:37 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I5d44b508a2a5211894c0cc7b6d51a9a03dc8b3f2

src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/cmd.h

index 7715e145260d7886bfac00683fa28b1d34362f7a..284f2921b2d551eb588d26ed2a03016dae9c7cfd 100644 (file)
@@ -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,
index 33cac66ffb09d17ace1b75e3e9dbdfadc4e4db0b..03f7cc1a40d88902e49677a2a07d414b8f35a8b0 100644 (file)
@@ -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,
This page took 0.027804 seconds and 4 git commands to generate.