]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
varlinkctl: drop bogus variable assignment
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Sat, 11 Apr 2026 10:44:03 +0000 (12:44 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Sat, 11 Apr 2026 12:58:34 +0000 (14:58 +0200)
Coverity complains that r is overridden. In fact it isn't, but
we shouldn't set it like this anyway. exec_with_listen_fds() already
logs, so we only need to call _exit() if it fails.

CID#1646716

src/varlinkctl/varlinkctl.c

index 18a639962c11f19b6d932d69ee87f35fed143be5..f2f8c271d47180ee7115df3cc8a42dfc5633533e 100644 (file)
@@ -700,8 +700,8 @@ static int varlink_call_and_upgrade(const char *url, const char *method, sd_json
                         _exit(EXIT_FAILURE);
                 }
 
-                r = exec_with_listen_fds(exec_cmdline, /* fds= */ NULL, /* n_fds= */ 0);
-                /* This is only reached on failure, otherwise we continue with exec_cmldine). */
+                (void) exec_with_listen_fds(exec_cmdline, /* fds= */ NULL, /* n_fds= */ 0);
+                /* This is only reached on failure, otherwise we continue with exec_cmdline). */
                 _exit(EXIT_FAILURE);
         }
 
@@ -993,7 +993,7 @@ static int verb_call(int argc, char *argv[], uintptr_t _data, void *userdata) {
                                 _exit(EXIT_FAILURE);
                         }
 
-                        exec_with_listen_fds(exec_cmdline, fd_array, m);
+                        (void) exec_with_listen_fds(exec_cmdline, fd_array, m);
                         /* This is only reached on failure, otherwise we continue with exec_cmdline. */
                         _exit(EXIT_FAILURE);
                 }