]> granicus.if.org Git - strace/commitdiff
Fix nanosleep decoding: second argument was not shown after success
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 28 Jan 2012 01:16:06 +0000 (02:16 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 28 Jan 2012 01:16:06 +0000 (02:16 +0100)
* time.c (sys_nanosleep): Fix bug - inverted is_restart_error() check.
* syscall.c (is_restart_error): Remove redundant check.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
syscall.c
time.c

index 88c976629957d9052e5cca2f424dbd54f9931429..2575317511bc66f05a7e649e48976d8a4b4a799a 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -716,8 +716,6 @@ int
 is_restart_error(struct tcb *tcp)
 {
 #ifdef LINUX
-       if (!syserror(tcp))
-               return 0;
        switch (tcp->u_error) {
                case ERESTARTSYS:
                case ERESTARTNOINTR:
diff --git a/time.c b/time.c
index 875d2246d7eae226c318de5b93cfee412e54a30e..497be75f785908bfe4ab31907d6496007ccb87a8 100644 (file)
--- a/time.c
+++ b/time.c
@@ -271,7 +271,7 @@ sys_nanosleep(struct tcb *tcp)
                print_timespec(tcp, tcp->u_arg[0]);
                tprints(", ");
        } else {
-               if (!tcp->u_arg[1] || is_restart_error(tcp))
+               if (!tcp->u_arg[1] || !is_restart_error(tcp))
                        print_timespec(tcp, tcp->u_arg[1]);
                else
                        tprintf("%#lx", tcp->u_arg[1]);