]> granicus.if.org Git - strace/commitdiff
Move get_regs error check from trace_syscall_entering to get_scno
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 23 Mar 2015 18:48:32 +0000 (18:48 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 23 Mar 2015 20:15:29 +0000 (20:15 +0000)
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.

syscall.c

index e42b8053a3140a1005a45fd603e16fed8051a77b..2bc82ca06643f4972b5b75975a9d1d6106ab0d37 100644 (file)
--- 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)