From: Luca Boccassi Date: Tue, 16 Sep 2025 09:11:58 +0000 (+0100) Subject: generators: fix parameters naming in symlink helper X-Git-Tag: v258~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=892838911b21113a20a8ef0ad4f2e5336753afc8;p=thirdparty%2Fsystemd.git generators: fix parameters naming in symlink helper 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 --- diff --git a/src/shared/generator.c b/src/shared/generator.c index f7ae848d6e1..3df988830d2 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -26,11 +26,11 @@ #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; }