From a8a80d326de9550b2a25b1255a2093ab43219ede Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sat, 27 Jan 2024 23:14:29 -0500 Subject: keyboard input --- kernel/vfile.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'kernel/vfile.cpp') 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; } -- cgit v1.2.3