summaryrefslogtreecommitdiff
path: root/src/test/test-seccomp.c
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-06-14 21:12:30 -0700
committerGitHub <noreply@github.com>2021-06-15 13:12:30 +0900
commit0643eb47a0418dc90d33853089dc9bc6ad63b0ca (patch)
treef1e0e0fe72ccfedbe14e827eb068f5c46c34e382 /src/test/test-seccomp.c
parent9868493e174c3d32b78318170bc98622c0c48f0b (diff)
downloadsystemd-0643eb47a0418dc90d33853089dc9bc6ad63b0ca.tar.gz
test-seccomp: Check for __NR_ppoll before use (#19858)
some newer architectures like riscv32 do not have __NR_ppoll from get go
Diffstat (limited to 'src/test/test-seccomp.c')
-rw-r--r--src/test/test-seccomp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c
index 4cca55c5bb..6c19c89147 100644
--- a/src/test/test-seccomp.c
+++ b/src/test/test-seccomp.c
@@ -837,7 +837,7 @@ static void test_load_syscall_filter_set_raw(void) {
assert_se(s = hashmap_new(NULL));
#if defined __NR_poll && __NR_poll >= 0
assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_poll + 1), INT_TO_PTR(-1)) >= 0);
-#else
+#elif defined __NR_ppoll
assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_ppoll + 1), INT_TO_PTR(-1)) >= 0);
#endif
@@ -854,7 +854,8 @@ static void test_load_syscall_filter_set_raw(void) {
assert_se(s = hashmap_new(NULL));
#if defined __NR_poll && __NR_poll >= 0
assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_poll + 1), INT_TO_PTR(EILSEQ)) >= 0);
-#else
+#elif defined __NR_ppoll
+ assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_ppoll + 1), INT_TO_PTR(-1)) >= 0);
assert_se(hashmap_put(s, UINT32_TO_PTR(__NR_ppoll + 1), INT_TO_PTR(EILSEQ)) >= 0);
#endif