]> granicus.if.org Git - strace/blobdiff - syscall.c
Fix multiple personalities support in decoding syscall return values
[strace] / syscall.c
index 36c1254e1097a855d8d504c7e503a08cface385c..cfd16e72d0ef85dafa20e0b8c5a9c4cefa74689e 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -2450,7 +2450,13 @@ trace_syscall_exiting(struct tcb *tcp)
                else {
                        switch (sys_res & RVAL_MASK) {
                        case RVAL_HEX:
-                               tprintf("= %#lx", tcp->u_rval);
+#if SUPPORTED_PERSONALITIES > 1
+                               if (current_wordsize < sizeof(long))
+                                       tprintf("= %#x",
+                                               (unsigned int) tcp->u_rval);
+                               else
+#endif
+                                       tprintf("= %#lx", tcp->u_rval);
                                break;
                        case RVAL_OCTAL:
                                tprintf("= %#lo", tcp->u_rval);