1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:27:43 +00:00

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

This commit is contained in:
Andreas Kling 2021-09-05 16:13:56 +02:00
parent 24e8ad5ade
commit c767e20f91

View file

@ -26,10 +26,8 @@ KResultOr<FlatPtr> Process::sys$chown(Userspace<const Syscall::SC_chown_params*>
Syscall::SC_chown_params params;
if (!copy_from_user(&params, user_params))
return EFAULT;
auto path = get_syscall_path_argument(params.path);
if (path.is_error())
return path.error();
return VirtualFileSystem::the().chown(path.value()->view(), params.uid, params.gid, current_directory());
auto path = TRY(get_syscall_path_argument(params.path));
return VirtualFileSystem::the().chown(path->view(), params.uid, params.gid, current_directory());
}
}