summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2021-10-08 03:01:45 +0200
committerEugene Syromyatnikov <evgsyr@gmail.com>2021-10-08 03:50:59 +0200
commitb3fe78d2dc549f1bf7b1297a0b1cef5c26ee5f82 (patch)
treea6afa0a4effbfa659a71e91269593eb4b94e52b5
parentbf6fc7290f479ad3d1e8d1f8537b741686d21145 (diff)
downloadstrace-b3fe78d2dc549f1bf7b1297a0b1cef5c26ee5f82.tar.gz
Remove PERSONALITY0_AUDIT_ARCH guards
Since PERSONALITY0_AUDIT_ARCH is defined for each architecture, there is no need to conditionalise on it. * src/linux/generic/nr_prefix.c (nr_prefix): Remove PERSONALITY0_AUDIT_ARCH guard. * src/syscall_name.c: Likewise. * tests/filter_seccomp-flag.c: Likewise.
-rw-r--r--src/linux/generic/nr_prefix.c2
-rw-r--r--src/syscall_name.c20
-rw-r--r--tests/filter_seccomp-flag.c12
3 files changed, 12 insertions, 22 deletions
diff --git a/src/linux/generic/nr_prefix.c b/src/linux/generic/nr_prefix.c
index 5ffafc107..0a75ae414 100644
--- a/src/linux/generic/nr_prefix.c
+++ b/src/linux/generic/nr_prefix.c
@@ -5,7 +5,6 @@
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
-#if defined PERSONALITY0_AUDIT_ARCH
/**
* Returns prefix for a syscall constant literal. It is has to be that way
* thanks to ARM that decided to prefix their special system calls like sys32
@@ -17,4 +16,3 @@ nr_prefix(kernel_ulong_t scno)
{
return "__NR_";
}
-#endif
diff --git a/src/syscall_name.c b/src/syscall_name.c
index 2c8a58631..72ba85bc3 100644
--- a/src/syscall_name.c
+++ b/src/syscall_name.c
@@ -15,24 +15,20 @@
#include "scno.h"
/* PERSONALITY*_AUDIT_ARCH definitions depend on AUDIT_ARCH_* constants. */
-#ifdef PERSONALITY0_AUDIT_ARCH
-# include <linux/audit.h>
-# define XLAT_MACROS_ONLY
-# include "xlat/elf_em.h"
-# include "xlat/audit_arch.h"
-# undef XLAT_MACROS_ONLY
-#endif
+#include <linux/audit.h>
+#define XLAT_MACROS_ONLY
+# include "xlat/elf_em.h"
+# include "xlat/audit_arch.h"
+#undef XLAT_MACROS_ONLY
#include "nr_prefix.c"
const struct audit_arch_t audit_arch_vec[SUPPORTED_PERSONALITIES] = {
-#ifdef PERSONALITY0_AUDIT_ARCH
PERSONALITY0_AUDIT_ARCH,
-# if SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
PERSONALITY1_AUDIT_ARCH,
-# if SUPPORTED_PERSONALITIES > 2
+# if SUPPORTED_PERSONALITIES > 2
PERSONALITY2_AUDIT_ARCH,
-# endif
# endif
#endif
};
@@ -47,7 +43,6 @@ syscall_name(kernel_ulong_t scno)
const char *
syscall_name_arch(kernel_ulong_t nr, unsigned int arch, const char **prefix)
{
-#ifdef PERSONALITY0_AUDIT_ARCH
for (size_t i = 0; i < SUPPORTED_PERSONALITIES; i++) {
if (arch != audit_arch_vec[i].arch)
continue;
@@ -69,7 +64,6 @@ syscall_name_arch(kernel_ulong_t nr, unsigned int arch, const char **prefix)
}
return sysent_vec[i][scno].sys_name;
}
-#endif
if (prefix)
*prefix = NULL;
diff --git a/tests/filter_seccomp-flag.c b/tests/filter_seccomp-flag.c
index 480db8942..5a81b8800 100644
--- a/tests/filter_seccomp-flag.c
+++ b/tests/filter_seccomp-flag.c
@@ -14,13 +14,11 @@
#include "scno.h"
/* PERSONALITY*_AUDIT_ARCH definitions depend on AUDIT_ARCH_* constants. */
-#ifdef PERSONALITY0_AUDIT_ARCH
-# include <linux/audit.h>
-# define XLAT_MACROS_ONLY
-# include "xlat/elf_em.h"
-# include "xlat/audit_arch.h"
-# undef XLAT_MACROS_ONLY
-#endif
+#include <linux/audit.h>
+#define XLAT_MACROS_ONLY
+# include "xlat/elf_em.h"
+# include "xlat/audit_arch.h"
+#undef XLAT_MACROS_ONLY
/* Define these shorthand notations to simplify the syscallent files. */
#include "sysent_shorthand_defs.h"