]> granicus.if.org Git - strace/commitdiff
syscall: move get_regs call from syscall_exiting_decode to get_syscall_result
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 24 Dec 2017 16:07:18 +0000 (16:07 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 24 Dec 2017 16:07:18 +0000 (16:07 +0000)
This make the code less confusing and opens the way for future changes
related to get_regs.

* syscall.c (syscall_exiting_decode): Move get_regs invocation ...
(get_syscall_result) [ptrace_getregset_or_getregs]: ... here.

syscall.c

index 7f914661b975268fc0211f982c7864045e32984d..65d43e1b1dbe8febc6b9adaceb9641ca6b3e9090 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -755,7 +755,7 @@ syscall_exiting_decode(struct tcb *tcp, struct timeval *ptv)
        update_personality(tcp, tcp->currpers);
 #endif
 
-       return get_regs(tcp->pid) < 0 ? -1 : get_syscall_result(tcp);
+       return get_syscall_result(tcp);
 }
 
 int
@@ -1236,7 +1236,10 @@ static int get_syscall_result_regs(struct tcb *);
 static int
 get_syscall_result(struct tcb *tcp)
 {
-#ifndef ptrace_getregset_or_getregs
+#ifdef ptrace_getregset_or_getregs
+       if (get_regs(tcp->pid) < 0)
+               return -1;
+#else
        if (get_syscall_result_regs(tcp))
                return -1;
 #endif