summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-05 16:04:55 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-05 16:25:40 +0200
commit4a2b0f6beceaf831df00932d4a999b43d5008d8c (patch)
treefac47d654279043592d7249b7bedc07f9f65f86b /Kernel
parentc1c774da91e79b1da6f4732149d3359df316b2b0 (diff)
downloadserenity-4a2b0f6beceaf831df00932d4a999b43d5008d8c.zip
Kernel: Use TRY() in sys$access()
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Syscalls/access.cpp6
1 files 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<FlatPtr> Process::sys$access(Userspace<const char*> 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());
}
}