Skip to content

Commit

Permalink
Kernel: Use TRY() in sys$mkdir()
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Sep 5, 2021
1 parent e899ea4 commit 2658ab4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Kernel/Syscalls/mkdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ KResultOr<FlatPtr> Process::sys$mkdir(Userspace<const char*> 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());
}
}

0 comments on commit 2658ab4

Please sign in to comment.