linux/x86_64/get_error.c: do not sign-extend if no error happened

This commit is contained in:
Eugene Syromyatnikov 2018-02-07 02:19:06 +01:00 committed by Dmitry V. Levin
parent c2bacdd427
commit 8e4b24701a

View File

@ -20,6 +20,9 @@ get_error(struct tcb *tcp, const bool check_errno)
tcp->u_rval = -1;
tcp->u_error = -rax;
} else {
tcp->u_rval = rax;
if (x86_io.iov_len == sizeof(i386_regs))
tcp->u_rval = (uint32_t) rax;
else
tcp->u_rval = rax;
}
}