From: Dmitry V. Levin Date: Thu, 20 Aug 2015 21:20:14 +0000 (+0000) Subject: Fix decoding of times syscall return value X-Git-Tag: v4.11~261 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d8ef5e70db3136b4a95452e195bb17426ae99724;p=strace Fix decoding of times syscall return value Always print return value of successful times syscall as unsigned long integer. * times.c (sys_times): Return RVAL_UDECIMAL unless syserror. --- diff --git a/times.c b/times.c index 0301c9f9..64729cfa 100644 --- a/times.c +++ b/times.c @@ -5,15 +5,17 @@ SYS_FUNC(times) { struct tms tbuf; - if (exiting(tcp)) { - if (!umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) { - tprintf("{tms_utime=%llu, tms_stime=%llu, ", - (unsigned long long) tbuf.tms_utime, - (unsigned long long) tbuf.tms_stime); - tprintf("tms_cutime=%llu, tms_cstime=%llu}", - (unsigned long long) tbuf.tms_cutime, - (unsigned long long) tbuf.tms_cstime); - } + if (entering(tcp)) + return 0; + + if (!umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) { + tprintf("{tms_utime=%llu, tms_stime=%llu, ", + (unsigned long long) tbuf.tms_utime, + (unsigned long long) tbuf.tms_stime); + tprintf("tms_cutime=%llu, tms_cstime=%llu}", + (unsigned long long) tbuf.tms_cutime, + (unsigned long long) tbuf.tms_cstime); } - return 0; + + return syserror(tcp) ? RVAL_DECIMAL : RVAL_UDECIMAL; }