mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
Kernel/ProcFS: Propagate errors correctly when they occur
Calling error() on KResult is a mistake I made in 7ba991dc37
, 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.
This commit is contained in:
parent
1d2bde2403
commit
0a5312730c
Notes:
sideshowbarker
2024-07-18 07:01:30 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/0a5312730c7 Pull-request: https://github.com/SerenityOS/serenity/pull/9385
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue