Skip to content

Commit

Permalink
elfexec: return 16bit ret value
Browse files Browse the repository at this point in the history
This way we can distinguish errors returned by elfexec() itself
and errors from DJ64 extension (like bad ELF file etc).
  • Loading branch information
stsp committed Oct 26, 2024
1 parent dfaf89c commit 63ceb5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libc/compat/go64/elfexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,6 @@ int elfexec(const char *path, int argc, char **argv)
regs.x.si = shmi.handle >> 16;
pltcall32(&regs, api);
__dpmi_free_shared_memory(shmi.handle);
return regs.d.eax;
/* returning only 16bit AX allows to distinguish with -1 returns above */
return regs.x.ax;
}

0 comments on commit 63ceb5e

Please sign in to comment.