mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Use TRY() in sys$statvfs()
This commit is contained in:
parent
7efa742a39
commit
4ea3dc77f0
Notes:
sideshowbarker
2024-07-18 04:41:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4ea3dc77f0c
1 changed files with 3 additions and 10 deletions
|
@ -12,11 +12,7 @@ namespace Kernel {
|
|||
|
||||
KResultOr<FlatPtr> Process::do_statvfs(String path, statvfs* buf)
|
||||
{
|
||||
auto custody_or_error = VirtualFileSystem::the().resolve_path(path, current_directory(), nullptr, 0);
|
||||
if (custody_or_error.is_error())
|
||||
return custody_or_error.error();
|
||||
|
||||
auto& custody = custody_or_error.value();
|
||||
auto custody = TRY(VirtualFileSystem::the().resolve_path(path, current_directory(), nullptr, 0));
|
||||
auto& inode = custody->inode();
|
||||
auto& fs = inode.fs();
|
||||
|
||||
|
@ -71,11 +67,8 @@ KResultOr<FlatPtr> Process::sys$statvfs(Userspace<const Syscall::SC_statvfs_para
|
|||
REQUIRE_PROMISE(rpath);
|
||||
auto params = TRY(copy_typed_from_user(user_params));
|
||||
|
||||
auto path = get_syscall_path_argument(params.path);
|
||||
if (path.is_error())
|
||||
return path.error();
|
||||
|
||||
return do_statvfs(path.value()->view(), params.buf);
|
||||
auto path = TRY(get_syscall_path_argument(params.path));
|
||||
return do_statvfs(path->view(), params.buf);
|
||||
}
|
||||
|
||||
KResultOr<FlatPtr> Process::sys$fstatvfs(int fd, statvfs* buf)
|
||||
|
|
Loading…
Reference in a new issue