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
+6 -6
View File
@@ -47,9 +47,9 @@ int touch_fd(int fd, usec_t stamp);
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
int touch(const char *path);
int symlinkat_idempotent(const char *from, int atfd, const char *to, bool make_relative);
static inline int symlink_idempotent(const char *from, const char *to, bool make_relative) {
return symlinkat_idempotent(from, AT_FDCWD, to, make_relative);
int symlinkat_idempotent(const char *target, int atfd, const char *linkpath, bool make_relative);
static inline int symlink_idempotent(const char *target, const char *linkpath, bool make_relative) {
return symlinkat_idempotent(target, AT_FDCWD, linkpath, make_relative);
}
typedef enum SymlinkFlags {
@@ -57,9 +57,9 @@ typedef enum SymlinkFlags {
SYMLINK_LABEL = 1 << 1,
} SymlinkFlags;
int symlinkat_atomic_full(const char *from, int atfd, const char *to, SymlinkFlags flags);
static inline int symlink_atomic(const char *from, const char *to) {
return symlinkat_atomic_full(from, AT_FDCWD, to, 0);
int symlinkat_atomic_full(const char *target, int atfd, const char *linkpath, SymlinkFlags flags);
static inline int symlink_atomic(const char *target, const char *linkpath) {
return symlinkat_atomic_full(target, AT_FDCWD, linkpath, 0);
}
int mknodat_atomic(int atfd, const char *path, mode_t mode, dev_t dev);