summaryrefslogtreecommitdiff
path: root/src/dissect
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-03-21 21:17:22 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-03-24 13:43:51 +0100
commitf461a28da70320473c7466bcdc34fa601da0877b (patch)
tree8cb409e11d95129f208468588d2fc670e9d81bd4 /src/dissect
parent0da2780c8a001e82695b261007966308be331bf3 (diff)
downloadsystemd-f461a28da70320473c7466bcdc34fa601da0877b.tar.gz
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.
Diffstat (limited to 'src/dissect')
-rw-r--r--src/dissect/dissect.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c
index 2658b2da60..ff00c4f567 100644
--- a/src/dissect/dissect.c
+++ b/src/dissect/dissect.c
@@ -13,7 +13,7 @@
#include "architecture.h"
#include "blockdev-util.h"
#include "build.h"
-#include "chase-symlinks.h"
+#include "chase.h"
#include "copy.h"
#include "device-util.h"
#include "devnum-util.h"
@@ -1237,7 +1237,7 @@ static int action_list_or_mtree_or_copy(DissectedImage *m, LoopDevice *d) {
case ACTION_COPY_FROM: {
_cleanup_close_ int source_fd = -EBADF, target_fd = -EBADF;
- source_fd = chase_symlinks_and_open(arg_source, mounted_dir, CHASE_PREFIX_ROOT|CHASE_WARN, O_RDONLY|O_CLOEXEC|O_NOCTTY, NULL);
+ source_fd = chase_and_open(arg_source, mounted_dir, CHASE_PREFIX_ROOT|CHASE_WARN, O_RDONLY|O_CLOEXEC|O_NOCTTY, NULL);
if (source_fd < 0)
return log_error_errno(source_fd, "Failed to open source path '%s' in image '%s': %m", arg_source, arg_image);
@@ -1294,7 +1294,7 @@ static int action_list_or_mtree_or_copy(DissectedImage *m, LoopDevice *d) {
return log_error_errno(r, "Failed to extract filename from target path '%s': %m", arg_target);
is_dir = r == O_DIRECTORY;
- r = chase_symlinks(dn, mounted_dir, CHASE_PREFIX_ROOT|CHASE_WARN, NULL, &dfd);
+ r = chase(dn, mounted_dir, CHASE_PREFIX_ROOT|CHASE_WARN, NULL, &dfd);
if (r < 0)
return log_error_errno(r, "Failed to open '%s': %m", dn);
@@ -1393,7 +1393,7 @@ static int action_umount(const char *path) {
_cleanup_(sd_device_unrefp) sd_device *dev = NULL;
int r;
- fd = chase_symlinks_and_open(path, NULL, 0, O_DIRECTORY, &canonical);
+ fd = chase_and_open(path, NULL, 0, O_DIRECTORY, &canonical);
if (fd == -ENOTDIR)
return log_error_errno(SYNTHETIC_ERRNO(ENOTDIR), "'%s' is not a directory", path);
if (fd < 0)