tests: use predefined exit codes when returning from main()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 7 Feb 2023 13:17:04 +0000 (14:17 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 7 Feb 2023 13:17:04 +0000 (14:17 +0100)
Use EXIT_FAILURE to indicate an error in main() instead of returning 1.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
tests/gpiod-test.c

index f57a0bed0c189229207eaa76df94badc4937720e..4e65ae2d260a0339f881ed7dfe0281b834095588 100644 (file)
@@ -4,6 +4,7 @@
 #include <errno.h>
 #include <linux/version.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/utsname.h>
 #include <unistd.h>
 
@@ -75,7 +76,7 @@ int main(int argc, char **argv)
        g_debug("%u tests registered", g_list_length(tests));
 
        if (!check_kernel())
-               return 1;
+               return EXIT_FAILURE;
 
        g_list_foreach(tests, add_test_from_list, NULL);
        g_list_free(tests);