summaryrefslogtreecommitdiff
path: root/kernel/vfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/vfile.cpp')
-rw-r--r--kernel/vfile.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/vfile.cpp b/kernel/vfile.cpp
index 028db6d..89c95e6 100644
--- a/kernel/vfile.cpp
+++ b/kernel/vfile.cpp
@@ -94,7 +94,7 @@ namespace hilbert::kernel::vfile {
full_path.rel(target_path);
vfile next;
- RET_NOT_SUC(lookup_path(full_path, next))
+ RET_NOT_SUC(lookup_path(full_path, next, false))
next.path = path;
return next.follow_symlinks(out);
@@ -175,7 +175,9 @@ namespace hilbert::kernel::vfile {
kernel::vfile::root = new vfile(root);
}
- storage::fs_result lookup_path(const canon_path &path, vfile &out) {
+ storage::fs_result lookup_path(
+ const canon_path &path, vfile &out, bool follow_final_symlink
+ ) {
//assume path is absolute.
@@ -191,6 +193,12 @@ namespace hilbert::kernel::vfile {
}
+ if (follow_final_symlink) {
+ vfile result;
+ RET_NOT_SUC(out.follow_symlinks(result))
+ out = utility::move(result);
+ }
+
return storage::fs_result::success;
}