Fix: lttng-disable-event: erroneous error code used in logging
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 Feb 2023 19:31:39 +0000 (14:31 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 6 Feb 2023 16:30:54 +0000 (11:30 -0500)
66cefebdc introduced `disable_ret` to hold the integral result of
lttng_disable_event_ext() instead of mixing enums and integers.

In doing so, one use site was left unmodified which resulted in the
wrong variable being used to log an error when the command failed.

This was spotted by clang:
  commands/disable_events.cpp:252:21: warning: result of comparison of
  constant -83 with expression of type 'enum   cmd_error_code' is always false [-Wtautological-constant-out-of-range-compare]
                                      command_ret == -LTTNG_ERR_NEED_CHANNEL_NAME ?

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I282ebee0140f7044847aab6c43ba6bd0c185fc46

src/bin/lttng/commands/disable_events.cpp

index f78222d9725032c42ef609bb44c14d16ee09f2da..454cb755c9d0b11de0f99ce80b42770dae58239f 100644 (file)
@@ -248,8 +248,8 @@ static int disable_events(char *session_name, char *event_list)
                                ERR("%s of type %s : %s (channel %s, session %s)",
                                    event_name,
                                    print_event_type((lttng_event_type) opt_event_type),
-                                   lttng_strerror(command_ret),
-                                   command_ret == -LTTNG_ERR_NEED_CHANNEL_NAME ?
+                                   lttng_strerror(disable_ret),
+                                   disable_ret == -LTTNG_ERR_NEED_CHANNEL_NAME ?
                                            print_raw_channel_name(channel_name) :
                                            print_channel_name(channel_name),
                                    session_name);
This page took 0.025421 seconds and 4 git commands to generate.