diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-01-28 02:29:36 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-01-28 02:29:36 +0100 |
commit | 64acaa1193173c965ef32919aa5c092ce912d57c (patch) | |
tree | edb03ff105e7c7d5edc1ac837bcd8f8c90574995 | |
parent | ea051f75331ee4c7a44d5449a2d136288314879a (diff) | |
download | strace-64acaa1193173c965ef32919aa5c092ce912d57c.tar.gz |
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 <vda.linux@googlemail.com>
-rw-r--r-- | time.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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; |