mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-08 18:11:52 +00:00
Kernel: Make UserOrKernelBuffer return KResult from read/write/memset
This allows us to simplify a whole bunch of call sites with TRY(). :^)
This commit is contained in:
parent
7bf8844499
commit
b481132418
Notes:
sideshowbarker
2024-07-18 04:32:10 +09:00
Author: https://github.com/awesomekling
Commit: b481132418
29 changed files with 85 additions and 118 deletions
|
@ -222,8 +222,9 @@ KResultOr<size_t> FileDescription::get_dir_entries(UserOrKernelBuffer& output_bu
|
|||
if (remaining < stream.size()) {
|
||||
error = EINVAL;
|
||||
return false;
|
||||
} else if (!output_buffer.write(stream.bytes())) {
|
||||
error = EFAULT;
|
||||
}
|
||||
if (auto result = output_buffer.write(stream.bytes()); result.is_error()) {
|
||||
error = result.release_error();
|
||||
return false;
|
||||
}
|
||||
output_buffer = output_buffer.offset(stream.size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue