1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:47:45 +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; Syscall::SC_chown_params params;
if (!copy_from_user(&params, user_params)) if (!copy_from_user(&params, user_params))
return EFAULT; return EFAULT;
auto path = get_syscall_path_argument(params.path); auto path = TRY(get_syscall_path_argument(params.path));
if (path.is_error()) return VirtualFileSystem::the().chown(path->view(), params.uid, params.gid, current_directory());
return path.error();
return VirtualFileSystem::the().chown(path.value()->view(), params.uid, params.gid, current_directory());
} }
} }