From 64acaa1193173c965ef32919aa5c092ce912d57c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 28 Jan 2012 02:29:36 +0100 Subject: [PATCH] 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 --- time.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.40.0