diff options
author | Benji Dial <benji@benjidial.net> | 2024-01-27 23:14:29 -0500 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-01-27 23:14:29 -0500 |
commit | a8a80d326de9550b2a25b1255a2093ab43219ede (patch) | |
tree | d42a800f735caf93679d1728e2d5f20004db3b65 /kernel/vfile.cpp | |
parent | 7199e74aa22e592a3b77bdd81f735edca5470596 (diff) | |
download | hilbert-os-a8a80d326de9550b2a25b1255a2093ab43219ede.tar.gz |
keyboard input
Diffstat (limited to 'kernel/vfile.cpp')
-rw-r--r-- | kernel/vfile.cpp | 12 |
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; } |