summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-01-28 02:29:36 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2012-01-28 02:29:36 +0100
commit64acaa1193173c965ef32919aa5c092ce912d57c (patch)
treeedb03ff105e7c7d5edc1ac837bcd8f8c90574995
parentea051f75331ee4c7a44d5449a2d136288314879a (diff)
downloadstrace-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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/time.c b/time.c
index 497be75f7..0c938f8ff 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;