From: Dmitry V. Levin Date: Thu, 7 Jan 2016 14:20:17 +0000 (+0000) Subject: Fix printing of 32-bit times syscall return value on 64-bit architectures X-Git-Tag: v4.12~675 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be1cb92c72267a1593d2573304101105ef2a5a3e;p=strace Fix printing of 32-bit times syscall return value on 64-bit architectures This change complements commit v4.9-359-gd93d9f8 by fixing RVAL_UDECIMAL case. The only syscall that appears to be affected is the times syscall. * syscall.c (trace_syscall_exiting): In case of RVAL_UDECIMAL, when current personality is 32-bit, print 32-bit return code. * NEWS: Mention this fix. Reported-by: Steve McIntyre --- diff --git a/NEWS b/NEWS index 03c64a83..731b4d47 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ Noteworthy changes in release ?.?? (????-??-??) * Bug fixes * Fixed build on arc, metag, nios2, or1k, and tile architectures. + * Fixed decoding of 32-bit times syscall return value on 64-bit architectures. Noteworthy changes in release 4.11 (2015-12-21) =============================================== diff --git a/syscall.c b/syscall.c index 8d81274a..b0e20eed 100644 --- a/syscall.c +++ b/syscall.c @@ -1064,7 +1064,13 @@ trace_syscall_exiting(struct tcb *tcp) tprintf("= %#lo", tcp->u_rval); break; case RVAL_UDECIMAL: - tprintf("= %lu", tcp->u_rval); +#if SUPPORTED_PERSONALITIES > 1 + if (current_wordsize < sizeof(long)) + tprintf("= %u", + (unsigned int) tcp->u_rval); + else +#endif + tprintf("= %lu", tcp->u_rval); break; case RVAL_DECIMAL: tprintf("= %ld", tcp->u_rval);