1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +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:
Andreas Kling 2021-03-19 10:43:58 +01:00
parent ed1789cc04
commit d48666489c
6 changed files with 37 additions and 24 deletions

View file

@ -559,7 +559,8 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
if (interpreter_description) {
main_program_fd = alloc_fd();
VERIFY(main_program_fd >= 0);
main_program_description->seek(0, SEEK_SET);
auto seek_result = main_program_description->seek(0, SEEK_SET);
VERIFY(!seek_result.is_error());
main_program_description->set_readable(true);
m_fds[main_program_fd].set(move(main_program_description), FD_CLOEXEC);
}