aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dearman <chris.dearman@imgtec.com>2015-10-22 12:34:56 +0100
committerChris Dearman <chris.dearman@imgtec.com>2015-12-14 20:28:32 +0000
commitce31a91f92f677e2712d1a7f03da607db17a6b82 (patch)
tree4c856af2ec0db43ad58e6ff5ed37fd5d73aa2435
parent75bc1ed95f269e1274dee1c13a1ce63bb6065ddb (diff)
downloadtlsdate-ce31a91f92f677e2712d1a7f03da607db17a6b82.tar.gz
Add MIPS little endian architectures and fix preprocessor indentation
MIPS has distinct architecture identifiers for big endian and little endian. This change adds the little endian identifiers and updates the preprocessor indentation to consistently use 2 spaces. Change-Id: Ia48ec946a5b4619cf29f83deef8de2adc0136af5
-rw-r--r--src/seccomp.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/seccomp.c b/src/seccomp.c
index 92c6e80..2e84dfc 100644
--- a/src/seccomp.c
+++ b/src/seccomp.c
@@ -27,8 +27,8 @@
/* Use a signal handler to emit violations when debugging */
#ifdef SECCOMP_FILTER_DEBUG
-# undef SECCOMP_FILTER_FAIL
-# define SECCOMP_FILTER_FAIL SECCOMP_RET_TRAP
+# undef SECCOMP_FILTER_FAIL
+# define SECCOMP_FILTER_FAIL SECCOMP_RET_TRAP
#endif /* SANDBOX_SECCOMP_FILTER_DEBUG */
/* Simple helpers to avoid manual errors (but larger BPF programs). */
@@ -44,18 +44,24 @@
#elif defined(__x86_64__)
# define SECCOMP_AUDIT_ARCH AUDIT_ARCH_X86_64
#elif defined(__arm__)
-# ifndef EM_ARM
-# define EM_ARM 40
-# endif
+# ifndef EM_ARM
+# define EM_ARM 40
+# endif
# define SECCOMP_AUDIT_ARCH AUDIT_ARCH_ARM
#elif defined(__aarch64__)
# define SECCOMP_AUDIT_ARCH AUDIT_ARCH_AARCH64
#elif defined(__mips__)
-# if defined(__LP64__)
-# define SECCOMP_AUDIT_ARCH AUDIT_ARCH_MIPS64
-# else
-# define SECCOMP_AUDIT_ARCH AUDIT_ARCH_MIPS
-# endif
+# if defined(__MIPSEL__)
+# if defined(__LP64__)
+# define SECCOMP_AUDIT_ARCH AUDIT_ARCH_MIPS64EL
+# else
+# define SECCOMP_AUDIT_ARCH AUDIT_ARCH_MIPSEL
+# endif
+# elif defined(__LP64__)
+# define SECCOMP_AUDIT_ARCH AUDIT_ARCH_MIPS64
+# else
+# define SECCOMP_AUDIT_ARCH AUDIT_ARCH_MIPS
+# endif
#else
# error "Platform does not support seccomp filter yet"
#endif