Change symlinks params to target & linkpath

This is what the symlinkat.2 man page uses.

The old naming with 'to' and 'from', where 'to' is the symlink name
and 'from' is the symlink target is very confusing.

Follow-up for 892838911b.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-09-18 12:36:50 +01:00
committed by Luca Boccassi
parent 3b3af5d020
commit 3b54efe78e
3 changed files with 27 additions and 27 deletions
+4 -4
View File
@@ -26,11 +26,11 @@
#include "tmpfile-util.h"
#include "unit-name.h"
static int symlink_unless_exists(const char *from, const char *to) {
(void) mkdir_parents(to, 0755);
static int symlink_unless_exists(const char *target, const char *linkpath) {
(void) mkdir_parents(linkpath, 0755);
if (symlink(from, to) < 0 && errno != EEXIST)
return log_error_errno(errno, "Failed to create symlink %s: %m", to);
if (symlink(target, linkpath) < 0 && errno != EEXIST)
return log_error_errno(errno, "Failed to create symlink %s: %m", linkpath);
return 0;
}