mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
Ext2FS: Clarify error handling in Ext2FSInode::read_bytes() somewhat
This commit is contained in:
parent
19fb62dd15
commit
b5b38d372c
Notes:
sideshowbarker
2024-07-18 20:36:07 +09:00
Author: https://github.com/awesomekling
Commit: b5b38d372c
1 changed files with 3 additions and 3 deletions
|
@ -900,10 +900,10 @@ ssize_t Ext2FSInode::read_bytes(off_t offset, ssize_t count, UserOrKernelBuffer&
|
|||
size_t offset_into_block = (bi == first_block_logical_index) ? offset_into_first_block : 0;
|
||||
size_t num_bytes_to_copy = min((off_t)block_size - offset_into_block, remaining_count);
|
||||
auto buffer_offset = buffer.offset(nread);
|
||||
int err = fs().read_block(block_index, &buffer_offset, num_bytes_to_copy, offset_into_block, allow_cache);
|
||||
if (err < 0) {
|
||||
auto result = fs().read_block(block_index, &buffer_offset, num_bytes_to_copy, offset_into_block, allow_cache);
|
||||
if (result.is_error()) {
|
||||
dmesgln("Ext2FSInode[{}]::read_bytes(): Failed to read block {} (index {})", identifier(), block_index.value(), bi);
|
||||
return err;
|
||||
return result.error();
|
||||
}
|
||||
remaining_count -= num_bytes_to_copy;
|
||||
nread += num_bytes_to_copy;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue