summaryrefslogtreecommitdiff
path: root/kernel/vfile.cpp
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-01-27 23:14:29 -0500
committerBenji Dial <benji@benjidial.net>2024-01-27 23:14:29 -0500
commita8a80d326de9550b2a25b1255a2093ab43219ede (patch)
treed42a800f735caf93679d1728e2d5f20004db3b65 /kernel/vfile.cpp
parent7199e74aa22e592a3b77bdd81f735edca5470596 (diff)
downloadhilbert-os-a8a80d326de9550b2a25b1255a2093ab43219ede.tar.gz
keyboard input
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;
}