From: Jérémie Galarneau Date: Thu, 19 Dec 2024 18:36:02 +0000 (+0000) Subject: Clean-up: relayd: remove unreachable code X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=da39078debff3a3891e4427c27ce0fd57153713b;p=lttng-tools.git Clean-up: relayd: remove unreachable code Coverity warns: 1568451 Structurally dead code Actions intended to be performed by the unreachable code will never occur. In relay_thread_listener(void *): Code block is unreachable because of the syntactic structure of the code (CWE-561) Use the appropriate error label to handle the file creation error. Change-Id: Id4f4eeae287a135d87ec21b14d1eade2afbb1f2c Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/main.cpp b/src/bin/lttng-relayd/main.cpp index 687904512..7a29290b0 100644 --- a/src/bin/lttng-relayd/main.cpp +++ b/src/bin/lttng-relayd/main.cpp @@ -1163,13 +1163,12 @@ static void *relay_thread_listener(void *data __attribute__((unused))) goto error_sock_control; } - if (auto _ret = utils_create_value_file(ntohs(control_sock->sockaddr.addr.sin.sin_port), - relayd_control_port_path)) { + if (const auto _ret = utils_create_value_file( + ntohs(control_sock->sockaddr.addr.sin.sin_port), relayd_control_port_path)) { ERR_FMT("Failed to create control port path file: port={}, path=`{}`, ret={}", ntohs(control_sock->sockaddr.addr.sin.sin_port), relayd_control_port_path, _ret); - goto error_create_poll; goto error_sock_relay; }