mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-20 18:12:53 +00:00
Kernel: Use TRY() in sys$realpath()
This commit is contained in:
parent
4ea3dc77f0
commit
1f475f7bbc
Notes:
sideshowbarker
2024-07-18 04:41:26 +09:00
Author: https://github.com/awesomekling
Commit: 1f475f7bbc
1 changed files with 2 additions and 7 deletions
|
@ -17,14 +17,9 @@ KResultOr<FlatPtr> Process::sys$realpath(Userspace<const Syscall::SC_realpath_pa
|
|||
REQUIRE_PROMISE(rpath);
|
||||
auto params = TRY(copy_typed_from_user(user_params));
|
||||
|
||||
auto path = get_syscall_path_argument(params.path);
|
||||
if (path.is_error())
|
||||
return path.error();
|
||||
auto path = TRY(get_syscall_path_argument(params.path));
|
||||
auto custody = TRY(VirtualFileSystem::the().resolve_path(path->view(), current_directory()));
|
||||
|
||||
auto custody_or_error = VirtualFileSystem::the().resolve_path(path.value()->view(), current_directory());
|
||||
if (custody_or_error.is_error())
|
||||
return custody_or_error.error();
|
||||
auto& custody = custody_or_error.value();
|
||||
auto absolute_path = custody->try_create_absolute_path();
|
||||
if (!absolute_path)
|
||||
return ENOMEM;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue