]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
generators: fix parameters naming in symlink helper
authorLuca Boccassi <luca.boccassi@gmail.com>
Tue, 16 Sep 2025 09:11:58 +0000 (10:11 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 16 Sep 2025 14:50:22 +0000 (16:50 +0200)
Coverity gets confused because the names were swapped. The parameters
are all passed in the right position, so there's no functional issue,
but the naming is confusing and trips static analyzers, so fix it.

CID#1621624

Follow-up for 8a9ab3dbbc86cf72ef8f511a3214f66a61f6bd01

src/shared/generator.c

index f7ae848d6e195cffe9db980b1f47edf181b73f4a..3df988830d2e038671b01f3b1245f023cfce93e8 100644 (file)
 #include "tmpfile-util.h"
 #include "unit-name.h"
 
-static int symlink_unless_exists(const char *to, const char *from) {
-        (void) mkdir_parents(from, 0755);
+static int symlink_unless_exists(const char *from, const char *to) {
+        (void) mkdir_parents(to, 0755);
 
-        if (symlink(to, from) < 0 && errno != EEXIST)
-                return log_error_errno(errno, "Failed to create symlink %s: %m", from);
+        if (symlink(from, to) < 0 && errno != EEXIST)
+                return log_error_errno(errno, "Failed to create symlink %s: %m", to);
         return 0;
 }