From 2658ab4a8093170f7cc3af2a151e9e380eea3958 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 16:18:00 +0200 Subject: [PATCH] Kernel: Use TRY() in sys$mkdir() --- Kernel/Syscalls/mkdir.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Kernel/Syscalls/mkdir.cpp b/Kernel/Syscalls/mkdir.cpp index b3b01a2004..2c7bd4665f 100644 --- a/Kernel/Syscalls/mkdir.cpp +++ b/Kernel/Syscalls/mkdir.cpp @@ -14,9 +14,7 @@ KResultOr Process::sys$mkdir(Userspace user_path, size_t p { VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(cpath); - auto path = get_syscall_path_argument(user_path, path_length); - if (path.is_error()) - return path.error(); - return VirtualFileSystem::the().mkdir(path.value()->view(), mode & ~umask(), current_directory()); + auto path = TRY(get_syscall_path_argument(user_path, path_length)); + return VirtualFileSystem::the().mkdir(path->view(), mode & ~umask(), current_directory()); } }