fs-util: rename laccess to access_nofollow

In order to distinguish it from libc function naming.
This commit is contained in:
Mike Yuan
2024-10-05 01:30:43 +02:00
parent 7c1dd9e288
commit 3f8999a76e
18 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -623,7 +623,7 @@ static int controller_is_v1_accessible(const char *root, const char *controller)
* - we can modify the hierarchy. */
cpath = strjoina("/sys/fs/cgroup/", dn, root, root ? "/cgroup.procs" : NULL);
return laccess(cpath, root ? W_OK : F_OK);
return access_nofollow(cpath, root ? W_OK : F_OK);
}
int cg_get_path_and_check(const char *controller, const char *path, const char *suffix, char **ret) {
+1 -1
View File
@@ -49,7 +49,7 @@ int futimens_opath(int fd, const struct timespec ts[2]);
int fd_warn_permissions(const char *path, int fd);
int stat_warn_permissions(const char *path, const struct stat *st);
#define laccess(path, mode) \
#define access_nofollow(path, mode) \
RET_NERRNO(faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW))
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
+1 -1
View File
@@ -97,7 +97,7 @@ int path_is_extension_tree(ImageClass image_class, const char *path, const char
/* Does the path exist at all? If not, generate an error immediately. This is useful so that a missing root dir
* always results in -ENOENT, and we can properly distinguish the case where the whole root doesn't exist from
* the case where just the os-release file is missing. */
r = laccess(path, F_OK);
r = access_nofollow(path, F_OK);
if (r < 0)
return r;
+1 -1
View File
@@ -918,7 +918,7 @@ int find_portable_profile(const char *name, const char *unit, char **ret_path) {
if (!joined)
return -ENOMEM;
r = laccess(joined, F_OK);
r = access_nofollow(joined, F_OK);
if (r >= 0) {
*ret_path = TAKE_PTR(joined);
return 0;