mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
Kernel: Make FileDescription::seek() return KResultOr<off_t>
This exposed a bunch of places where errors were not propagated, so this patch is forced to deal with them as well.
This commit is contained in:
parent
ed1789cc04
commit
d48666489c
6 changed files with 37 additions and 24 deletions
|
@ -84,8 +84,11 @@ KResultOr<ssize_t> Process::do_write(FileDescription& description, const UserOrK
|
|||
return EAGAIN;
|
||||
}
|
||||
|
||||
if (description.should_append())
|
||||
description.seek(0, SEEK_END);
|
||||
if (description.should_append()) {
|
||||
auto seek_result = description.seek(0, SEEK_END);
|
||||
if (seek_result.is_error())
|
||||
return seek_result.error();
|
||||
}
|
||||
|
||||
while ((size_t)total_nwritten < data_size) {
|
||||
if (!description.can_write()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue