diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-06 20:34:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-06 20:34:54 +0200 |
commit | 1c543598f15f50332aa8162b1ee6b141ba53252b (patch) | |
tree | 62a1df35075b73c7bce7c1119d9a9961fd71646e | |
parent | bdb697f6deeacfa1955e46974932deed39a2efc9 (diff) | |
download | serenity-1c543598f15f50332aa8162b1ee6b141ba53252b.zip |
Kernel: Use TRY() in ProcessProcFSTraits::to_inode()
-rw-r--r-- | Kernel/ProcessProcFSTraits.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Kernel/ProcessProcFSTraits.cpp b/Kernel/ProcessProcFSTraits.cpp index cc0de44d7e..71d8c9afc6 100644 --- a/Kernel/ProcessProcFSTraits.cpp +++ b/Kernel/ProcessProcFSTraits.cpp @@ -42,10 +42,7 @@ KResultOr<NonnullRefPtr<Inode>> Process::ProcessProcFSTraits::to_inode(const Pro if (!process) return ESRCH; - auto maybe_inode = ProcFSProcessDirectoryInode::try_create(procfs_instance, process->pid()); - if (maybe_inode.is_error()) - return maybe_inode.error(); - return maybe_inode.release_value(); + return TRY(ProcFSProcessDirectoryInode::try_create(procfs_instance, process->pid())); } KResult Process::ProcessProcFSTraits::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const |