1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

Kernel: Use TRY() in sys$mkdir()

This commit is contained in:
Andreas Kling 2021-09-05 16:18:00 +02:00
parent e899ea459c
commit 2658ab4a80

View file

@ -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());
}
}