]> granicus.if.org Git - strace/commitdiff
Return RVAL_STR unconditionally
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 4 Apr 2018 13:47:49 +0000 (15:47 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 4 Apr 2018 20:32:42 +0000 (20:32 +0000)
There is no reason to check for auxstr being non-NULL
because syscall_exiting_trace already does the check.

* sched.c (SYS_FUNC(sched_getscheduler)): Do not check tcp->auxstr,
return RVAL_STR unconditionally.
* time.c (do_adjtimex): Likewise.

sched.c
time.c

diff --git a/sched.c b/sched.c
index 5e74c2ee7b736b9b197efc049f4d9c5b1629b259..394fcafbb784fe815d934eb7ca2abd7e8c15e632 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -42,8 +42,7 @@ SYS_FUNC(sched_getscheduler)
                tprintf("%d", (int) tcp->u_arg[0]);
        } else if (!syserror(tcp)) {
                tcp->auxstr = xlookup(schedulers, (kernel_ulong_t) tcp->u_rval);
-               if (tcp->auxstr != NULL)
-                       return RVAL_STR;
+               return RVAL_STR;
        }
        return 0;
 }
diff --git a/time.c b/time.c
index 31f44fc65ebb524d308687e0e5116eff312208c2..fa8c9db4d53051585e5dae31797cf2cb29f2178e 100644 (file)
--- a/time.c
+++ b/time.c
@@ -173,9 +173,7 @@ do_adjtimex(struct tcb *const tcp, const kernel_ulong_t addr)
        if (print_timex(tcp, addr))
                return 0;
        tcp->auxstr = xlookup(adjtimex_state, (kernel_ulong_t) tcp->u_rval);
-       if (tcp->auxstr)
-               return RVAL_STR;
-       return 0;
+       return RVAL_STR;
 }
 
 SYS_FUNC(adjtimex)