diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-12-02 17:53:27 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-12-02 17:57:10 +0100 |
commit | 1fe6e5c1127451554779f29d5e1aea2c557d1c37 (patch) | |
tree | 2065a74cac74a75fefcb4f66bfb8c39a2957a1c3 /src/basic/chase-symlinks.c | |
parent | basic: add fallback in chase_symlinks_and_opendir() for cases when /proc is n... (diff) | |
download | systemd-1fe6e5c1127451554779f29d5e1aea2c557d1c37.tar.xz systemd-1fe6e5c1127451554779f29d5e1aea2c557d1c37.zip |
Revert "basic: add fallback in chase_symlinks_and_opendir() for cases when /proc is not mounted"
This reverts commit 3e22dfc2352bb5c4f058e23a82f424655b599b18.
Diffstat (limited to '')
-rw-r--r-- | src/basic/chase-symlinks.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/basic/chase-symlinks.c b/src/basic/chase-symlinks.c index 118a6ee68f..0bb07000ba 100644 --- a/src/basic/chase-symlinks.c +++ b/src/basic/chase-symlinks.c @@ -552,22 +552,14 @@ int chase_symlinks_and_opendir( return 0; } - r = chase_symlinks(path, root, chase_flags, &p, &path_fd); + r = chase_symlinks(path, root, chase_flags, ret_path ? &p : NULL, &path_fd); if (r < 0) return r; assert(path_fd >= 0); d = opendir(FORMAT_PROC_FD_PATH(path_fd)); - if (!d) { - /* Hmm, we have the fd already but we got ENOENT, most likely /proc is not mounted. - * Let's try opendir() again on the full path. */ - if (errno == ENOENT) { - d = opendir(p); - if (!d) - return -errno; - } else - return -errno; - } + if (!d) + return -errno; if (ret_path) *ret_path = TAKE_PTR(p); |