]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-seccomp: minor simpification
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 3 Aug 2020 15:46:48 +0000 (17:46 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 5 Aug 2020 08:49:46 +0000 (10:49 +0200)
src/test/test-seccomp.c

index eec2779a9e2a69cec60f08365b0ab4a26213bdf1..cebf5a1080b6d7a5a02cac823c192da2baeb7c45 100644 (file)
@@ -98,9 +98,6 @@ static void test_syscall_filter_set_find(void) {
 }
 
 static void test_filter_sets(void) {
-        unsigned i;
-        int r;
-
         log_info("/* %s */", __func__);
 
         if (!is_seccomp_available()) {
@@ -112,7 +109,7 @@ static void test_filter_sets(void) {
                 return;
         }
 
-        for (i = 0; i < _SYSCALL_FILTER_SET_MAX; i++) {
+        for (unsigned i = 0; i < _SYSCALL_FILTER_SET_MAX; i++) {
                 pid_t pid;
 
                 log_info("Testing %s", syscall_filter_sets[i].name);
@@ -121,7 +118,7 @@ static void test_filter_sets(void) {
                 assert_se(pid >= 0);
 
                 if (pid == 0) { /* Child? */
-                        int fd;
+                        int fd, r;
 
                         /* If we look at the default set (or one that includes it), allow-list instead of deny-list */
                         if (IN_SET(i, SYSCALL_FILTER_SET_DEFAULT, SYSCALL_FILTER_SET_SYSTEM_SERVICE))