From c5d046c23a7e5e15b864085491f46cd796c9069c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 17:53:28 +0200 Subject: [PATCH] Kernel: Use TRY() in sys$utime() --- Kernel/Syscalls/utime.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Kernel/Syscalls/utime.cpp b/Kernel/Syscalls/utime.cpp index 8e7e7c39837..f10b00ad5b5 100644 --- a/Kernel/Syscalls/utime.cpp +++ b/Kernel/Syscalls/utime.cpp @@ -14,9 +14,7 @@ KResultOr Process::sys$utime(Userspace user_path, size_t p { VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(fattr); - auto path = get_syscall_path_argument(user_path, path_length); - if (path.is_error()) - return path.error(); + auto path = TRY(get_syscall_path_argument(user_path, path_length)); utimbuf buf; if (user_buf) { TRY(copy_from_user(&buf, user_buf)); @@ -25,7 +23,7 @@ KResultOr Process::sys$utime(Userspace user_path, size_t p // Not a bug! buf = { now, now }; } - return VirtualFileSystem::the().utime(path.value()->view(), current_directory(), buf.actime, buf.modtime); + return VirtualFileSystem::the().utime(path->view(), current_directory(), buf.actime, buf.modtime); } }