]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-path: decrease variable scope
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 22 Jul 2020 10:12:54 +0000 (12:12 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 22 Jul 2020 10:12:54 +0000 (12:12 +0200)
src/test/test-path.c

index 0b2b4ab554d354bbdefc56747d17aa807cee4ead..e8844fd5ef4fc1178e92d269cdb9252f55192ac3 100644 (file)
@@ -346,10 +346,8 @@ int main(int argc, char *argv[]) {
                 NULL,
         };
 
-        _cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
         _cleanup_free_ char *test_path = NULL;
-        const test_function_t *test = NULL;
-        Manager *m = NULL;
+        _cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
 
         umask(022);
 
@@ -359,7 +357,8 @@ int main(int argc, char *argv[]) {
         assert_se(set_unit_path(test_path) >= 0);
         assert_se(runtime_dir = setup_fake_runtime_dir());
 
-        for (test = tests; test && *test; test++) {
+        for (const test_function_t *test = tests; test && *test; test++) {
+                Manager *m = NULL;
                 int r;
 
                 /* We create a clean environment for each test */