Sign extend the error value for failing Linux/i386 system calls. This

restores the mapping of Linux errors to native FreeBSD errno values after
the refactoring in r288424.
This commit is contained in:
John Baldwin 2016-02-15 20:26:40 +00:00
parent 501ce0d86b
commit 142482cda6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295636

View File

@ -115,6 +115,8 @@ amd64_linux32_fetch_retval(struct trussinfo *trussinfo, long *retval,
retval[0] = regs.r_rax & 0xffffffff;
retval[1] = regs.r_rdx & 0xffffffff;
*errorp = !!(regs.r_rflags & PSL_C);
if (*errorp)
retval[0] = (int)retval[0];
if (*errorp) {
for (i = 0; i < nitems(bsd_to_linux_errno); i++) {