From: Dmitry V. Levin Date: Mon, 23 Mar 2015 18:48:32 +0000 (+0000) Subject: Move get_regs error check from trace_syscall_entering to get_scno X-Git-Tag: v4.11~550 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=144cda220ba4d3be92d636ed01b454589dc85c32;p=strace Move get_regs error check from trace_syscall_entering to get_scno Starting with commit v4.10-25-g8497b62, get_scno() can be called outside trace_syscall_entering(), so move the get_regs_error check from trace_syscall_entering() to get_scno(). * syscall.c (trace_syscall_entering): Move get_regs_error check ... (get_scno): ... here. --- diff --git a/syscall.c b/syscall.c index e42b8053..2bc82ca0 100644 --- a/syscall.c +++ b/syscall.c @@ -1129,6 +1129,9 @@ get_regs(pid_t pid) int get_scno(struct tcb *tcp) { + if (get_regs_error) + return -1; + long scno = 0; #if defined(S390) || defined(S390X) @@ -1752,7 +1755,7 @@ trace_syscall_entering(struct tcb *tcp) { int res, scno_good; - scno_good = res = (get_regs_error ? -1 : get_scno(tcp)); + scno_good = res = get_scno(tcp); if (res == 0) return res; if (res == 1)