From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 43991158086 for ; Thu, 21 Oct 2021 01:51:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3558FE0896; Thu, 21 Oct 2021 01:51:35 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 18C50E0896 for ; Thu, 21 Oct 2021 01:51:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9C1AF342B3C for ; Thu, 21 Oct 2021 01:51:03 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E9E0C151 for ; Thu, 21 Oct 2021 01:51:01 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1634780616.861541d1080fca9400c264c221bc5ec6b48de1b0.vapier@gentoo> Subject: [gentoo-commits] proj/sandbox:master commit in: libsandbox/ X-VCS-Repository: proj/sandbox X-VCS-Files: libsandbox/trace.c X-VCS-Directories: libsandbox/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 861541d1080fca9400c264c221bc5ec6b48de1b0 X-VCS-Branch: master Date: Thu, 21 Oct 2021 01:51:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 568d9ee5-cede-4c0a-90de-32365d43f56a X-Archives-Hash: 678fb10f7ed440beb73e953de2e573aa commit: 861541d1080fca9400c264c221bc5ec6b48de1b0 Author: Mike Frysinger gentoo org> AuthorDate: Thu Oct 21 01:43:36 2021 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Oct 21 01:43:36 2021 +0000 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=861541d1 libsandbox: drop redundant regs ptrace lookup We don't need to lookup the register set twice, so drop the 2nd call. These parts of the code were merged during a refactor and while they made sense when they were in separate places, they don't here. Signed-off-by: Mike Frysinger gentoo.org> libsandbox/trace.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libsandbox/trace.c b/libsandbox/trace.c index 3efef23..fc700e3 100644 --- a/libsandbox/trace.c +++ b/libsandbox/trace.c @@ -467,9 +467,8 @@ static void trace_loop(void) ret = trace_get_regs(®s); nr = trace_get_sysnum(®s); - se = lookup_syscall_in_tbl(tbl_after_fork, nr); - ret = trace_get_regs(®s); + if (before_syscall) { _sb_debug("%s:%i", se ? se->name : "IDK", nr); if (!trace_check_syscall(se, ®s)) {