Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sandbox:master commit in: libsandbox/
Date: Thu, 21 Oct 2021 01:51:36
Message-Id: 1634780616.861541d1080fca9400c264c221bc5ec6b48de1b0.vapier@gentoo
1 commit: 861541d1080fca9400c264c221bc5ec6b48de1b0
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 21 01:43:36 2021 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 21 01:43:36 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=861541d1
7
8 libsandbox: drop redundant regs ptrace lookup
9
10 We don't need to lookup the register set twice, so drop the 2nd call.
11 These parts of the code were merged during a refactor and while they
12 made sense when they were in separate places, they don't here.
13
14 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
15
16 libsandbox/trace.c | 3 +--
17 1 file changed, 1 insertion(+), 2 deletions(-)
18
19 diff --git a/libsandbox/trace.c b/libsandbox/trace.c
20 index 3efef23..fc700e3 100644
21 --- a/libsandbox/trace.c
22 +++ b/libsandbox/trace.c
23 @@ -467,9 +467,8 @@ static void trace_loop(void)
24
25 ret = trace_get_regs(&regs);
26 nr = trace_get_sysnum(&regs);
27 -
28 se = lookup_syscall_in_tbl(tbl_after_fork, nr);
29 - ret = trace_get_regs(&regs);
30 +
31 if (before_syscall) {
32 _sb_debug("%s:%i", se ? se->name : "IDK", nr);
33 if (!trace_check_syscall(se, &regs)) {