mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-12 02:30:30 +09:00
Kernel: Use TRY() more in process-specific ProcFS code
This commit is contained in:
parent
f4a6b60570
commit
398f8e7c96
Notes:
sideshowbarker
2024-07-18 04:38:35 +09:00
Author: https://github.com/awesomekling
Commit: 398f8e7c96
2 changed files with 4 additions and 19 deletions
|
@ -172,29 +172,17 @@ KResultOr<size_t> ProcFSExposedLink::read_bytes(off_t offset, size_t count, User
|
|||
|
||||
KResultOr<NonnullRefPtr<Inode>> ProcFSExposedLink::to_inode(const ProcFS& procfs_instance) const
|
||||
{
|
||||
auto maybe_inode = ProcFSLinkInode::try_create(procfs_instance, *this);
|
||||
if (maybe_inode.is_error())
|
||||
return maybe_inode.error();
|
||||
|
||||
return maybe_inode.release_value();
|
||||
return TRY(ProcFSLinkInode::try_create(procfs_instance, *this));
|
||||
}
|
||||
|
||||
KResultOr<NonnullRefPtr<Inode>> ProcFSExposedComponent::to_inode(const ProcFS& procfs_instance) const
|
||||
{
|
||||
auto maybe_inode = ProcFSGlobalInode::try_create(procfs_instance, *this);
|
||||
if (maybe_inode.is_error())
|
||||
return maybe_inode.error();
|
||||
|
||||
return maybe_inode.release_value();
|
||||
return TRY(ProcFSGlobalInode::try_create(procfs_instance, *this));
|
||||
}
|
||||
|
||||
KResultOr<NonnullRefPtr<Inode>> ProcFSExposedDirectory::to_inode(const ProcFS& procfs_instance) const
|
||||
{
|
||||
auto maybe_inode = ProcFSDirectoryInode::try_create(procfs_instance, *this);
|
||||
if (maybe_inode.is_error())
|
||||
return maybe_inode.error();
|
||||
|
||||
return maybe_inode.release_value();
|
||||
return TRY(ProcFSDirectoryInode::try_create(procfs_instance, *this));
|
||||
}
|
||||
|
||||
void ProcFSExposedDirectory::add_component(const ProcFSExposedComponent&)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue