From: Denys Vlasenko Date: Sat, 28 Jan 2012 01:29:36 +0000 (+0100) Subject: Revert last change. Add a comment to prevent further misunderstanding X-Git-Tag: v4.7~188 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64acaa1193173c965ef32919aa5c092ce912d57c;p=strace Revert last change. Add a comment to prevent further misunderstanding * time.c (sys_nanosleep): Display remaining time only on interrupt. Signed-off-by: Denys Vlasenko --- diff --git a/time.c b/time.c index 497be75f..0c938f8f 100644 --- a/time.c +++ b/time.c @@ -271,9 +271,15 @@ sys_nanosleep(struct tcb *tcp) print_timespec(tcp, tcp->u_arg[0]); tprints(", "); } else { - if (!tcp->u_arg[1] || !is_restart_error(tcp)) + /* Second (returned) timespec is only significant + * if syscall was interrupted. We print only its address + * on _success_, since kernel doesn't modify its value. + */ + if (is_restart_error(tcp) || !tcp->u_arg[1]) + /* Interrupted (or NULL) */ print_timespec(tcp, tcp->u_arg[1]); else + /* Success */ tprintf("%#lx", tcp->u_arg[1]); } return 0;