Author: jhb
Date: Mon Feb 15 20:26:40 2016
New Revision: 295636
URL: https://svnweb.freebsd.org/changeset/base/295636

Log:
  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.

Modified:
  head/usr.bin/truss/amd64-linux32.c

Modified: head/usr.bin/truss/amd64-linux32.c
==============================================================================
--- head/usr.bin/truss/amd64-linux32.c  Mon Feb 15 19:56:35 2016        
(r295635)
+++ head/usr.bin/truss/amd64-linux32.c  Mon Feb 15 20:26:40 2016        
(r295636)
@@ -115,6 +115,8 @@ amd64_linux32_fetch_retval(struct trussi
        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++) {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to