diff options
author | Liav A <liavalb@gmail.com> | 2021-08-13 19:20:32 +0300 |
---|---|---|
committer | Gunnar Beutner <gunnar@beutner.name> | 2021-08-13 20:07:43 +0200 |
commit | 0a5312730c7cfb41c2da26dcd9d83b78de63fd27 (patch) | |
tree | 5d9276760dce26fef28eedd8d51b5361f8db9a60 /Kernel/FileSystem | |
parent | 1d2bde24030d7a71dd117a0772dc224f0344b364 (diff) | |
download | serenity-0a5312730c7cfb41c2da26dcd9d83b78de63fd27.zip |
Kernel/ProcFS: Propagate errors correctly when they occur
Calling error() on KResult is a mistake I made in 7ba991dc371, so
instead of doing that, which triggers an assertion if an error occured,
in Inode::read_entire method with VERIFY(nread <= sizeof(buffer)), we
really should just return the KResult and not to call error() on it.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/ProcFS.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index 0f4f098f17..2a6e7c64e9 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -486,7 +486,7 @@ KResultOr<size_t> ProcFSProcessPropertyInode::read_bytes(off_t offset, size_t co if (!process) return KResult(ESRCH); if (auto result = try_to_acquire_data(*process, builder); result.is_error()) - return result.error(); + return result; auto data_buffer = builder.build(); if (!data_buffer) return KResult(EFAULT); |