diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-03-26 14:15:43 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | 63c466f3bf2dce3f7c19fb2e7bbf9f081ac60030 (patch) | |
tree | 6e8ec16d3b05780ae4cf9f5b38a619c248f19476 /src/basic/fs-util.c | |
parent | 32cda0c8683c2817afb5eee58662fd445f688408 (diff) |
fs-util: add calls that combine chase_symlinks() and open()/opendir() in one
This is useful when opening files within disk images, as we'll then take
the relative root directory properly into account.
Diffstat (limited to 'src/basic/fs-util.c')
-rw-r--r-- | src/basic/fs-util.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index fe8554842..d43aca249 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -649,16 +649,6 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags, if (noop_root(original_root)) original_root = NULL; - if (!original_root && !ret && (flags & (CHASE_NONEXISTENT|CHASE_NO_AUTOFS|CHASE_SAFE|CHASE_OPEN)) == CHASE_OPEN) { - /* Shortcut the CHASE_OPEN case if the caller isn't interested in the actual path and has no root set - * and doesn't care about any of the other special features we provide either. */ - r = open(path, O_PATH|O_CLOEXEC); - if (r < 0) - return -errno; - - return r; - } - if (original_root) { r = path_make_absolute_cwd(original_root, &root); if (r < 0) |