From: Jérémie Galarneau Date: Fri, 3 Feb 2023 19:31:39 +0000 (-0500) Subject: Fix: lttng-disable-event: erroneous error code used in logging X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ed0c6be4278ed647f5f7d682169557b72776484e;p=lttng-tools.git Fix: lttng-disable-event: erroneous error code used in logging 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 Change-Id: I282ebee0140f7044847aab6c43ba6bd0c185fc46 --- diff --git a/src/bin/lttng/commands/disable_events.cpp b/src/bin/lttng/commands/disable_events.cpp index f78222d97..454cb755c 100644 --- a/src/bin/lttng/commands/disable_events.cpp +++ b/src/bin/lttng/commands/disable_events.cpp @@ -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);