chase-symlinks: Rename chase_symlinks() to chase()

Chasing symlinks is a core function that's used in a lot of places
so it deservers a less verbose names so let's rename it to chase()
and chaseat().

We also slightly change the pattern used for the chaseat() helpers
so we get chase_and_openat() and similar.
This commit is contained in:
Daan De Meyer
2023-03-24 13:43:51 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 0da2780c8a
commit f461a28da7
64 changed files with 374 additions and 384 deletions
+3 -3
View File
@@ -5,7 +5,7 @@
#include <string.h>
#include "alloc-util.h"
#include "chase-symlinks.h"
#include "chase.h"
#include "fd-util.h"
#include "format-util.h"
#include "fs-util.h"
@@ -47,7 +47,7 @@ int mkdirat_safe_internal(
if ((flags & MKDIR_FOLLOW_SYMLINK) && S_ISLNK(st.st_mode)) {
_cleanup_free_ char *p = NULL;
r = chase_symlinks_at(dir_fd, path, CHASE_NONEXISTENT, &p, NULL);
r = chaseat(dir_fd, path, CHASE_NONEXISTENT, &p, NULL);
if (r < 0)
return r;
if (r == 0)
@@ -234,7 +234,7 @@ int mkdir_p_root(const char *root, const char *p, uid_t uid, gid_t gid, mode_t m
if (r < 0)
return r;
dfd = chase_symlinks_and_open(pp, root, CHASE_PREFIX_ROOT, O_RDONLY|O_CLOEXEC|O_DIRECTORY, NULL);
dfd = chase_and_open(pp, root, CHASE_PREFIX_ROOT, O_RDONLY|O_CLOEXEC|O_DIRECTORY, NULL);
if (dfd < 0)
return dfd;
}