svn commit: r295636 - head/usr.bin/truss

John Baldwin jhb at FreeBSD.org
Mon Feb 15 20:26:42 UTC 2016


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++) {


More information about the svn-src-all mailing list