mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Kernel: Fix two error codes being returned as positive in Process::exec
This made the assertion on line 921 think it was a successful exec, when it wasn't. Fixes #5084
This commit is contained in:
parent
1c18d1380f
commit
50a2cb38e5
1 changed files with 2 additions and 2 deletions
|
@ -819,12 +819,12 @@ int Process::exec(String path, Vector<String> arguments, Vector<String> environm
|
|||
// #2) ELF32 for i386
|
||||
|
||||
if (nread_or_error.value() < (int)sizeof(Elf32_Ehdr))
|
||||
return ENOEXEC;
|
||||
return -ENOEXEC;
|
||||
auto main_program_header = (Elf32_Ehdr*)first_page;
|
||||
|
||||
if (!ELF::validate_elf_header(*main_program_header, metadata.size)) {
|
||||
dbgln("exec({}): File has invalid ELF header", path);
|
||||
return ENOEXEC;
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
auto elf_result = find_elf_interpreter_for_executable(path, *main_program_header, nread_or_error.value(), metadata.size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue