From 4a2b0f6beceaf831df00932d4a999b43d5008d8c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 16:04:55 +0200 Subject: [PATCH] Kernel: Use TRY() in sys$access() --- Kernel/Syscalls/access.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Kernel/Syscalls/access.cpp b/Kernel/Syscalls/access.cpp index 267231a6d0..2e2c27d71c 100644 --- a/Kernel/Syscalls/access.cpp +++ b/Kernel/Syscalls/access.cpp @@ -14,10 +14,8 @@ KResultOr Process::sys$access(Userspace user_path, size_t { VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this); REQUIRE_PROMISE(rpath); - auto path = get_syscall_path_argument(user_path, path_length); - if (path.is_error()) - return path.error(); - return VirtualFileSystem::the().access(path.value()->view(), mode, current_directory()); + auto path = TRY(get_syscall_path_argument(user_path, path_length)); + return VirtualFileSystem::the().access(path->view(), mode, current_directory()); } }