]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-seccomp: Check for __NR_ppoll before use (#19858)
authorKhem Raj <raj.khem@gmail.com>
Tue, 15 Jun 2021 04:12:30 +0000 (21:12 -0700)
committerGitHub <noreply@github.com>
Tue, 15 Jun 2021 04:12:30 +0000 (13:12 +0900)
some newer architectures like riscv32 do not have __NR_ppoll from get go

src/test/test-seccomp.c

index 4cca55c5bbb73fb6342fa4b78e49a3fb7b6c0b42..6c19c8914756aba77111d861f3ff58ea0133b69b 100644 (file)
@@ -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