mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 09:18: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
|
@ -745,9 +745,7 @@ KResultOr<size_t> Plan9FSInode::read_bytes(off_t offset, size_t size, UserOrKern
|
|||
|
||||
// Guard against the server returning more data than requested.
|
||||
size_t nread = min(data.length(), size);
|
||||
if (!buffer.write(data.characters_without_null_termination(), nread))
|
||||
return EFAULT;
|
||||
|
||||
TRY(buffer.write(data.characters_without_null_termination(), nread));
|
||||
return nread;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue