]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: remove exit() calls from main()
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 13 Jun 2025 16:45:34 +0000 (17:45 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 16 Jun 2025 12:37:42 +0000 (07:37 -0500)
There is no particular reason for us to use exit(), so just avoid it.

As result, the only instances using of exit() are within the child
process and our cleanup is complete :-)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/371
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
testsuite/testsuite.h

index 9b7a562029f18c9b756a10adbfc9e2acd299e818..ae17a3216ff1f97185136c526ff023fe35584127 100644 (file)
@@ -161,7 +161,7 @@ int test_run(const struct test *t);
                        t = test_find(__start_kmod_tests, __stop_kmod_tests, argv[arg]); \
                        if (t == NULL) {                                                 \
                                fprintf(stderr, "could not find test %s\n", argv[arg]);  \
-                               exit(EXIT_FAILURE);                                      \
+                               return EXIT_FAILURE;                                     \
                        }                                                                \
                                                                                          \
                        return test_run(t);                                              \
@@ -172,5 +172,5 @@ int test_run(const struct test *t);
                                ret = EXIT_FAILURE;                                      \
                }                                                                        \
                                                                                          \
-               exit(ret);                                                               \
+               return ret;                                                              \
        }