summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-device
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/libsystemd/sd-device
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/libsystemd/sd-device')
-rw-r--r--src/libsystemd/sd-device/sd-device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index 8c65ee3469..e86ec3e75b 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -8,7 +8,7 @@
#include "sd-device.h"
#include "alloc-util.h"
-#include "chase-symlinks.h"
+#include "chase.h"
#include "device-internal.h"
#include "device-private.h"
#include "device-util.h"
@@ -150,7 +150,7 @@ int device_set_syspath(sd_device *device, const char *_syspath, bool verify) {
/* The input path maybe a symlink located outside of /sys. Let's try to chase the symlink at first.
* The primary usecase is that e.g. /proc/device-tree is a symlink to /sys/firmware/devicetree/base.
* By chasing symlinks in the path at first, we can call sd_device_new_from_path() with such path. */
- r = chase_symlinks(_syspath, NULL, 0, &syspath, &fd);
+ r = chase(_syspath, NULL, 0, &syspath, &fd);
if (r == -ENOENT)
/* the device does not exist (any more?) */
return log_debug_errno(SYNTHETIC_ERRNO(ENODEV),
@@ -163,7 +163,7 @@ int device_set_syspath(sd_device *device, const char *_syspath, bool verify) {
char *p;
/* /sys is a symlink to somewhere sysfs is mounted on? In that case, we convert the path to real sysfs to "/sys". */
- r = chase_symlinks("/sys", NULL, 0, &real_sys, NULL);
+ r = chase("/sys", NULL, 0, &real_sys, NULL);
if (r < 0)
return log_debug_errno(r, "sd-device: Failed to chase symlink /sys: %m");