From: Denys Vlasenko Date: Wed, 15 Apr 2009 13:31:59 +0000 (+0000) Subject: * signal (sys_rt_sigtimedwait): Fix sigtimedwait syscall decoding. X-Git-Tag: v4.5.19~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1a78cf3eeef995a9fd4bcf39ac7179fdc381979;p=strace * signal (sys_rt_sigtimedwait): Fix sigtimedwait syscall decoding. --- diff --git a/ChangeLog b/ChangeLog index 901331da..6ae08a34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-15 Denys Vlasenko + + * signal (sys_rt_sigtimedwait): Fix sigtimedwait syscall decoding. + 2009-04-15 Denys Vlasenko * signal (sys_rt_sigaction): Print struct sigaction correctly diff --git a/signal.c b/signal.c index e2a4af6f..403fe3b5 100644 --- a/signal.c +++ b/signal.c @@ -2034,21 +2034,32 @@ int sys_rt_sigtimedwait(struct tcb *tcp) else printsigmask(&sigset, 1); tprintf(", "); + /* This is the only "return" parameter, */ + if (tcp->u_arg[1] != 0) + return 0; + /* ... if it's NULL, can decode all on entry */ + tprintf("NULL, "); } - else { + else if (tcp->u_arg[1] != 0) { + /* syscall exit, and u_arg[1] wasn't NULL */ if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[0]); + tprintf("%#lx, ", tcp->u_arg[1]); else { siginfo_t si; if (umove(tcp, tcp->u_arg[1], &si) < 0) - tprintf("%#lx", tcp->u_arg[1]); - else + tprintf("%#lx, ", tcp->u_arg[1]); + else { printsiginfo(&si, verbose(tcp)); - /* XXX For now */ - tprintf(", %#lx", tcp->u_arg[2]); - tprintf(", %d", (int) tcp->u_arg[3]); + tprintf(", "); + } } } + else { + /* syscall exit, and u_arg[1] was NULL */ + return 0; + } + print_timespec(tcp, tcp->u_arg[2]); + tprintf(", %d", (int) tcp->u_arg[3]); return 0; };