]> granicus.if.org Git - strace/commitdiff
2008-07-17 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Fri, 18 Jul 2008 02:16:47 +0000 (02:16 +0000)
committerRoland McGrath <roland@redhat.com>
Fri, 18 Jul 2008 02:16:47 +0000 (02:16 +0000)
* process.c (printwaitn): When current personality's wordsize is
smaller than native, sign-extend the PID argument from 32 bits.

process.c

index ec41b499896afd16dc56a2759439717582ce3eaa..6791ba3c9edc13079ae5a1f39c7d1dde9116f3cb 100644 (file)
--- a/process.c
+++ b/process.c
@@ -1947,7 +1947,13 @@ int bitness;
        int exited = 0;
 
        if (entering(tcp)) {
-               tprintf("%ld, ", tcp->u_arg[0]);
+               /*
+                * Sign-extend a 32-bit value when that's what it is.
+                */
+               long pid = tcp->u_arg[0];
+               if (personality_wordsize[current_personality] < sizeof pid)
+                       pid = (long) (int) pid;
+               tprintf("%ld, ", pid);
        } else {
                /* status */
                if (!tcp->u_arg[1])