test: the created files list doesn't need to be a global
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 16 Oct 2024 01:08:41 +0000 (11:08 +1000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 30 Oct 2024 23:20:42 +0000 (23:20 +0000)
This list was used in the signal handler but that is no longer the case,
so let's localize this.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>

test/litest.c

index fa9f91df207e9f4736e9abc9202e51d30b0aaddf..5e08f4231b0a905986607a7700754f8f4760680d 100644 (file)
@@ -109,8 +109,6 @@ created_file_unlink(struct created_file *f)
        rmdir(f->path);
 }
 
-static struct list created_files_list; /* list of all files to remove at the end
-                                         of the test run */
 static struct suite *current_suite = NULL;
 
 static void litest_init_udev_rules(struct list *created_files_list);
@@ -1122,7 +1120,7 @@ litest_run(struct list *suites)
        if (setrlimit(RLIMIT_CORE, &corelimit) != 0)
                perror("WARNING: Core dumps not disabled");
 
-       list_init(&created_files_list);
+       struct list created_files_list = LIST_INIT(created_files_list);
 
        if (run_deviceless) {
                litest_setup_quirks(&created_files_list,