From 892838911b21113a20a8ef0ad4f2e5336753afc8 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 16 Sep 2025 10:11:58 +0100 Subject: [PATCH] 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 --- src/shared/generator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shared/generator.c b/src/shared/generator.c index f7ae848d6e..3df988830d 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; }