]> granicus.if.org Git - strace/commitdiff
Fix printing of 32-bit times syscall return value on 64-bit architectures
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 7 Jan 2016 14:20:17 +0000 (14:20 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 7 Jan 2016 19:47:23 +0000 (19:47 +0000)
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 <steve@einval.com>
NEWS
syscall.c

diff --git a/NEWS b/NEWS
index 03c64a8382eb1283155cb0953c8b74187f515993..731b4d47820331e97ec2d55a003917bad8c5267e 100644 (file)
--- 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)
 ===============================================
index 8d81274a76f7f22055a36641b46cc608d6842cdd..b0e20eeda971f5cb929fca548980534da2cddedf 100644 (file)
--- 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);