]> git.lttng.org Git - lttng-tools.git/commitdiff
Clean-up: relayd: remove unreachable code
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Dec 2024 18:36:02 +0000 (18:36 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 28 Jan 2025 19:09:17 +0000 (19:09 +0000)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/main.cpp

index 68790451224be58f76f2f5521e9799a4ee3415fa..7a29290b0726b735621d8d8cbb8ef4807e7f8561 100644 (file)
@@ -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;
        }
 
This page took 0.031353 seconds and 4 git commands to generate.