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 ED208158086 for ; Sun, 17 Oct 2021 05:15:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 35C8EE086F; Sun, 17 Oct 2021 05:15:40 +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 DF9E4E086F for ; Sun, 17 Oct 2021 05:15:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 817A534300B for ; Sun, 17 Oct 2021 05:15:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DBF01101 for ; Sun, 17 Oct 2021 05:15:35 +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: <1634438744.acc9835d8c96451f88b65822f1f6b5b4f27594e0.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: seccomp-bpf.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: acc9835d8c96451f88b65822f1f6b5b4f27594e0 X-VCS-Branch: master Date: Sun, 17 Oct 2021 05:15:35 +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: bede7cd8-7815-4d9d-b954-030b99425c3d X-Archives-Hash: 2ba77eaef16617ac7d54e6653d43c83d commit: acc9835d8c96451f88b65822f1f6b5b4f27594e0 Author: Mike Frysinger gentoo org> AuthorDate: Sun Oct 17 02:45:44 2021 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Sun Oct 17 02:45:44 2021 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=acc9835d seccomp: mark arrays const+static This generates better code, although it doesn't super matter since this is only used at build time. Signed-off-by: Mike Frysinger gentoo.org> seccomp-bpf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seccomp-bpf.c b/seccomp-bpf.c index 5279d20..6a095a4 100644 --- a/seccomp-bpf.c +++ b/seccomp-bpf.c @@ -49,7 +49,7 @@ static const struct { }; /* Simple helper to add all of the syscalls in an array. */ -static int gen_seccomp_rules_add(scmp_filter_ctx ctx, int syscalls[], size_t num) +static int gen_seccomp_rules_add(scmp_filter_ctx ctx, const int syscalls[], size_t num) { static uint8_t prio; size_t i; @@ -102,7 +102,7 @@ static void gen_seccomp_program(const char *name) int main(void) { /* Order determines priority (first == lowest prio). */ - int base_syscalls[] = { + static const int base_syscalls[] = { /* We write the most w/scanelf. */ SCMP_SYS(write), SCMP_SYS(writev), @@ -194,7 +194,7 @@ int main(void) /* glibc-2.34+ uses it as part of mem alloc functions. */ SCMP_SYS(getrandom), }; - int fork_syscalls[] = { + static const int fork_syscalls[] = { SCMP_SYS(clone), SCMP_SYS(execve), SCMP_SYS(fork),