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 8a9ab3dbbc
This commit is contained in:
Luca Boccassi
2025-09-16 10:11:58 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 775a31bdfa
commit 892838911b

View File

@@ -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;
}