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:
parent
24e8ad5ade
commit
c767e20f91
1 changed files with 2 additions and 4 deletions
|
@ -26,10 +26,8 @@ KResultOr<FlatPtr> Process::sys$chown(Userspace<const Syscall::SC_chown_params*>
|
|||
Syscall::SC_chown_params params;
|
||||
if (!copy_from_user(¶ms, 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue