From 5b63d963ac98fb1ea1233a3d4886f65c9b0515e3 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 18 Jul 2008 02:16:47 +0000 Subject: [PATCH] 2008-07-17 Roland McGrath * process.c (printwaitn): When current personality's wordsize is smaller than native, sign-extend the PID argument from 32 bits. --- process.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/process.c b/process.c index ec41b499..6791ba3c 100644 --- 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]) -- 2.40.0