From 4381bb2a223286519005d0296eb0a87a358a560b Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Wed, 20 Feb 2019 21:09:03 +0100 Subject: [PATCH] tests: Remove redundant return statements When the execution reaches the end of the main functions, they implicitly return a successful status. --- tests/args.c | 2 -- tests/ctype.c | 7 ++++--- tests/dirent/main.c | 2 -- tests/error.c | 2 -- tests/fcntl/fcntl.c | 2 -- tests/libgen.c | 1 - tests/math.c | 2 -- tests/netdb/getaddrinfo.c | 2 -- tests/stdio/all.c | 1 - tests/stdio/fputs.c | 2 -- tests/stdio/fread.c | 2 -- tests/stdio/freopen.c | 2 -- tests/stdio/fwrite.c | 1 - tests/stdio/popen.c | 2 -- tests/stdio/printf.c | 2 -- tests/stdio/setvbuf.c | 1 - tests/stdlib/a64l.c | 1 - tests/stdlib/alloc.c | 2 -- tests/stdlib/atof.c | 1 - tests/stdlib/atoi.c | 1 - tests/stdlib/bsearch.c | 1 - tests/stdlib/div.c | 3 --- tests/stdlib/mkostemps.c | 1 - tests/stdlib/mktemp.c | 1 - tests/stdlib/strtol.c | 2 -- tests/stdlib/strtoul.c | 2 -- tests/stdlib/system.c | 1 - tests/string/mem.c | 1 - tests/string/strcat.c | 3 --- tests/string/strchr.c | 3 --- tests/string/strcspn.c | 3 --- tests/string/strncmp.c | 3 --- tests/string/strpbrk.c | 5 +---- tests/string/strrchr.c | 1 - tests/string/strspn.c | 3 --- tests/string/strstr.c | 3 --- tests/string/strtok.c | 3 --- tests/string/strtok_r.c | 3 --- tests/time/asctime.c | 1 - tests/time/gmtime.c | 1 - tests/time/time.c | 2 -- tests/unistd/brk.c | 2 -- tests/unistd/chdir.c | 1 - tests/unistd/dup.c | 2 -- tests/unistd/exec.c | 2 -- tests/unistd/fchdir.c | 2 -- tests/unistd/fsync.c | 2 -- tests/unistd/ftruncate.c | 2 -- tests/unistd/getid.c | 2 -- tests/unistd/pathconf.c | 2 -- tests/unistd/pipe.c | 1 - tests/unistd/rmdir.c | 2 -- tests/unistd/setid.c | 2 -- tests/unistd/sleep.c | 2 -- tests/unistd/sysconf.c | 2 -- tests/unistd/write.c | 2 -- tests/waitpid.c | 1 - tests/wchar/putwchar.c | 2 -- 58 files changed, 5 insertions(+), 110 deletions(-) diff --git a/tests/args.c b/tests/args.c index 9f59c9012d..49e7ae0ff4 100644 --- a/tests/args.c +++ b/tests/args.c @@ -1,4 +1,3 @@ -#include #include #include @@ -9,5 +8,4 @@ int main(int argc, char *argv[]) { write(STDOUT_FILENO, " ", 1); } write(STDOUT_FILENO, "\n", 1); - return EXIT_SUCCESS; } diff --git a/tests/ctype.c b/tests/ctype.c index 40ba65ae47..1dd70680f2 100644 --- a/tests/ctype.c +++ b/tests/ctype.c @@ -1,5 +1,6 @@ #include #include +#include struct test_case { int c; @@ -289,12 +290,12 @@ size_t num_test_cases = sizeof(test_cases) / sizeof(struct test_case); #define CHECK_TEST(tc, fn, retval) \ if (fn(tc.c) != tc.fn) { \ - retval = -1; \ + retval = EXIT_FAILURE; \ printf("Unexpected result: " #fn "('%c') != %d // Char value: %d\n", tc.c, tc.fn, tc.c); \ } int main(void) { - int retval = 0; + int retval = EXIT_SUCCESS; for(int i = 0; i < num_test_cases; ++i) { struct test_case tc = test_cases[i]; @@ -316,7 +317,7 @@ int main(void) { CHECK_TEST(tc, toupper, retval); } - if (!retval) { + if (retval == EXIT_SUCCESS) { printf("Success: %d\n", retval); } else { printf("Failure: %d\n", retval); diff --git a/tests/dirent/main.c b/tests/dirent/main.c index aa574ba7d3..92a4fe2467 100644 --- a/tests/dirent/main.c +++ b/tests/dirent/main.c @@ -38,6 +38,4 @@ int main(void) { // puts(entry->d_name); closedir(dir); - - return EXIT_SUCCESS; } diff --git a/tests/error.c b/tests/error.c index 3bfd5217ff..09756286f8 100644 --- a/tests/error.c +++ b/tests/error.c @@ -1,6 +1,5 @@ #include #include -#include #include #include @@ -8,5 +7,4 @@ int main(void) { chdir("nonexistent"); printf("errno: %d = %s\n", errno, strerror(errno)); perror("perror"); - return EXIT_SUCCESS; } diff --git a/tests/fcntl/fcntl.c b/tests/fcntl/fcntl.c index d6f85a9a46..3ec16a84d1 100644 --- a/tests/fcntl/fcntl.c +++ b/tests/fcntl/fcntl.c @@ -1,6 +1,5 @@ #include #include -#include #include int main(void) { @@ -11,5 +10,4 @@ int main(void) { printf("fd %d duped into fd %d\n", newfd, newfd2); close(newfd); close(newfd2); - return EXIT_SUCCESS; } diff --git a/tests/libgen.c b/tests/libgen.c index 4feee89bf0..91b18a4f3c 100644 --- a/tests/libgen.c +++ b/tests/libgen.c @@ -77,5 +77,4 @@ int main(void) { printf("Testing libgen.h\n"); test_basename(); test_dirname(); - return EXIT_SUCCESS; } diff --git a/tests/math.c b/tests/math.c index b061097755..9f485b1b0e 100644 --- a/tests/math.c +++ b/tests/math.c @@ -1,10 +1,8 @@ #include #include -#include int main(void) { double pi = 3.14; float c = cos(pi); printf("cos(%f) = %f\n", pi, c); - return EXIT_SUCCESS; } diff --git a/tests/netdb/getaddrinfo.c b/tests/netdb/getaddrinfo.c index efe4c5dfec..1c92a86307 100644 --- a/tests/netdb/getaddrinfo.c +++ b/tests/netdb/getaddrinfo.c @@ -45,6 +45,4 @@ int main(void) { res = res->ai_next; } - - return EXIT_SUCCESS; } diff --git a/tests/stdio/all.c b/tests/stdio/all.c index 33a5f905b1..d1e393e307 100644 --- a/tests/stdio/all.c +++ b/tests/stdio/all.c @@ -9,5 +9,4 @@ int main(void) { printf("%s\n", fgets(in, 30, f)); setvbuf(stdout, 0, _IONBF, 0); printf("Hello\n"); - return EXIT_SUCCESS; } diff --git a/tests/stdio/fputs.c b/tests/stdio/fputs.c index 74424b20ee..52aef7da68 100644 --- a/tests/stdio/fputs.c +++ b/tests/stdio/fputs.c @@ -1,5 +1,4 @@ #include -#include #include int main(void) { @@ -7,5 +6,4 @@ int main(void) { char *in = "Hello World!"; fputs(in, f); // calls fwrite, helpers::fwritex, internal::to_write and internal::stdio_write fclose(f); - return EXIT_SUCCESS; } diff --git a/tests/stdio/fread.c b/tests/stdio/fread.c index 6e95bc7291..e5e13b28cb 100644 --- a/tests/stdio/fread.c +++ b/tests/stdio/fread.c @@ -17,6 +17,4 @@ int main(void) { } fclose(fp); - - return EXIT_SUCCESS; } diff --git a/tests/stdio/freopen.c b/tests/stdio/freopen.c index b68a858383..e7ec2c271d 100644 --- a/tests/stdio/freopen.c +++ b/tests/stdio/freopen.c @@ -1,10 +1,8 @@ #include -#include int main(void) { freopen("stdio/stdio.in", "r", stdin); char in[6]; fgets(in, 6, stdin); printf("%s\n", in); // should print Hello - return EXIT_SUCCESS; } diff --git a/tests/stdio/fwrite.c b/tests/stdio/fwrite.c index 93f412413c..9132420bff 100644 --- a/tests/stdio/fwrite.c +++ b/tests/stdio/fwrite.c @@ -20,5 +20,4 @@ int main(void) { fwrite(ptr, sizeof(ptr), 1, f); fclose(f); - return EXIT_SUCCESS; } diff --git a/tests/stdio/popen.c b/tests/stdio/popen.c index 89f1d9a097..afa83fab0a 100644 --- a/tests/stdio/popen.c +++ b/tests/stdio/popen.c @@ -25,6 +25,4 @@ int main(void) { } else { printf("status %x\n", status); } - - return EXIT_SUCCESS; } diff --git a/tests/stdio/printf.c b/tests/stdio/printf.c index ebe84e79d0..ea7b8dde02 100644 --- a/tests/stdio/printf.c +++ b/tests/stdio/printf.c @@ -1,5 +1,4 @@ #include -#include int main(void) { int sofar = 0; @@ -49,5 +48,4 @@ int main(void) { printf("%G\n", 0.0001); printf("%G\n", 0.00001); printf("%E\n", 0.00001); - return EXIT_SUCCESS; } diff --git a/tests/stdio/setvbuf.c b/tests/stdio/setvbuf.c index 8d38913cf2..2b0356bf15 100644 --- a/tests/stdio/setvbuf.c +++ b/tests/stdio/setvbuf.c @@ -10,5 +10,4 @@ int main(void) { char *in = malloc(30); printf("%s\n", fgets(in, 30, f)); printf("Hello\n"); - return EXIT_SUCCESS; } diff --git a/tests/stdlib/a64l.c b/tests/stdlib/a64l.c index 0ffb73effc..7c44bb84ed 100644 --- a/tests/stdlib/a64l.c +++ b/tests/stdlib/a64l.c @@ -18,5 +18,4 @@ int main(void) { return EXIT_FAILURE; } printf("Correct a64l: %s = %ld\n", s, l); - return EXIT_SUCCESS; } diff --git a/tests/stdlib/alloc.c b/tests/stdlib/alloc.c index 4e0b72de3d..b21dfadb18 100644 --- a/tests/stdlib/alloc.c +++ b/tests/stdlib/alloc.c @@ -24,6 +24,4 @@ int main(void) { ptra[i] = (char)i; } free(ptra); - - return EXIT_SUCCESS; } diff --git a/tests/stdlib/atof.c b/tests/stdlib/atof.c index f686bd12c2..19f6e25c77 100644 --- a/tests/stdlib/atof.c +++ b/tests/stdlib/atof.c @@ -4,5 +4,4 @@ int main(void) { double d = atof("-3.14"); printf("%f\n", d); - return EXIT_SUCCESS; } diff --git a/tests/stdlib/atoi.c b/tests/stdlib/atoi.c index 2960697f02..3e06f29c89 100644 --- a/tests/stdlib/atoi.c +++ b/tests/stdlib/atoi.c @@ -8,5 +8,4 @@ int main(void) { printf("%ld\n", atol(" -42")); printf("%ld\n", atol(" +555")); printf("%ld\n", atol(" 1234567890 ")); - return EXIT_SUCCESS; } diff --git a/tests/stdlib/bsearch.c b/tests/stdlib/bsearch.c index 834e56e2cd..a56756a77a 100644 --- a/tests/stdlib/bsearch.c +++ b/tests/stdlib/bsearch.c @@ -53,5 +53,4 @@ int main(void) { BSEARCH_TEST_INT(x, big, 7, NULL); printf("PASS bsearch\n"); - return EXIT_SUCCESS; } diff --git a/tests/stdlib/div.c b/tests/stdlib/div.c index 9939f07b47..394e842378 100644 --- a/tests/stdlib/div.c +++ b/tests/stdlib/div.c @@ -16,8 +16,5 @@ int main(void) { ll = mydivt.rem; ll = atoll("10"); _Exit(0); - - ; - return EXIT_SUCCESS; } diff --git a/tests/stdlib/mkostemps.c b/tests/stdlib/mkostemps.c index 5af996f6b3..aa544e9aa7 100644 --- a/tests/stdlib/mkostemps.c +++ b/tests/stdlib/mkostemps.c @@ -23,5 +23,4 @@ int main(void) { } fclose(fp); remove(file_name); - return EXIT_SUCCESS; } diff --git a/tests/stdlib/mktemp.c b/tests/stdlib/mktemp.c index 02c2e72e26..0a23e6ed25 100644 --- a/tests/stdlib/mktemp.c +++ b/tests/stdlib/mktemp.c @@ -8,5 +8,4 @@ int main(void) { mktemp(string); printf("%s\n",string); free(string); - return EXIT_SUCCESS; } diff --git a/tests/stdlib/strtol.c b/tests/stdlib/strtol.c index 283a622c05..2977d64747 100644 --- a/tests/stdlib/strtol.c +++ b/tests/stdlib/strtol.c @@ -26,6 +26,4 @@ int main(void) { if(errno != 0) { printf("errno is not 0 (%d), something went wrong\n", errno); } - - return EXIT_SUCCESS; } diff --git a/tests/stdlib/strtoul.c b/tests/stdlib/strtoul.c index d33ca9b7f8..afb903cb38 100644 --- a/tests/stdlib/strtoul.c +++ b/tests/stdlib/strtoul.c @@ -25,6 +25,4 @@ int main(void) { if(errno != 0) { printf("errno is not 0 (%d), something went wrong\n", errno); } - - return EXIT_SUCCESS; } diff --git a/tests/stdlib/system.c b/tests/stdlib/system.c index 9b3270eb79..5e9d662cd6 100644 --- a/tests/stdlib/system.c +++ b/tests/stdlib/system.c @@ -2,5 +2,4 @@ int main(void) { system("echo test of system"); - return EXIT_SUCCESS; } diff --git a/tests/string/mem.c b/tests/string/mem.c index 9c8db1e8c0..2b717d6c75 100644 --- a/tests/string/mem.c +++ b/tests/string/mem.c @@ -38,5 +38,4 @@ int main(void) { return EXIT_FAILURE; } puts("Correct memcmp"); - return EXIT_SUCCESS; } diff --git a/tests/string/strcat.c b/tests/string/strcat.c index cb58004d1d..0653b7f480 100644 --- a/tests/string/strcat.c +++ b/tests/string/strcat.c @@ -1,6 +1,5 @@ #include #include -#include int main(void) { char dest1[12] = "hello"; @@ -8,6 +7,4 @@ int main(void) { char dest2[12] = "hello"; printf("%s\n", strncat(dest2, " world foobar", 6)); // should be hello world - - return EXIT_SUCCESS; } diff --git a/tests/string/strchr.c b/tests/string/strchr.c index 3273d88a73..fb2e07e056 100644 --- a/tests/string/strchr.c +++ b/tests/string/strchr.c @@ -1,11 +1,8 @@ #include #include -#include int main(void) { printf("%s\n", strchr("hello", 'e')); // should be ello printf("%s\n", strchr("world", 'l')); // should be ld printf("%i\n", strchr("world", 0) == NULL); // should be 1 - - return EXIT_SUCCESS; } diff --git a/tests/string/strcspn.c b/tests/string/strcspn.c index 8511b95cb9..7370558c91 100644 --- a/tests/string/strcspn.c +++ b/tests/string/strcspn.c @@ -1,11 +1,8 @@ #include #include -#include int main(void) { char *world = "world"; printf("%ld\n", strcspn("hello", world)); // should be 2 printf("%ld\n", strcspn("banana", world)); // should be 6 - - return EXIT_SUCCESS; } diff --git a/tests/string/strncmp.c b/tests/string/strncmp.c index 913200be7c..fd4033c8e6 100644 --- a/tests/string/strncmp.c +++ b/tests/string/strncmp.c @@ -1,6 +1,5 @@ #include #include -#include int main(void) { printf("%d\n", strncmp("a", "aa", 2)); @@ -9,6 +8,4 @@ int main(void) { printf("%d\n", strncmp("", "\xFF", 1)); printf("%d\n", strncmp("a", "c", 1)); printf("%d\n", strncmp("a", "a", 2)); - - return EXIT_SUCCESS; } diff --git a/tests/string/strpbrk.c b/tests/string/strpbrk.c index d61de16956..bb5ca56ee0 100644 --- a/tests/string/strpbrk.c +++ b/tests/string/strpbrk.c @@ -1,6 +1,5 @@ #include #include -#include int main(void) { char* source = "The quick drawn fix jumps over the lazy bug"; @@ -15,7 +14,5 @@ int main(void) { // should be "NULL" char* res3 = strpbrk(source, "404"); - printf("%s\n", (res3) ? res3 : "NULL"); - - return EXIT_SUCCESS; + printf("%s\n", (res3) ? res3 : "NULL"); } diff --git a/tests/string/strrchr.c b/tests/string/strrchr.c index c8d2f65ad5..d32c244ff1 100644 --- a/tests/string/strrchr.c +++ b/tests/string/strrchr.c @@ -18,5 +18,4 @@ int main(void) { return EXIT_FAILURE; } printf("strrch PASS, exiting with status code %d\n", 0); - return EXIT_SUCCESS; } diff --git a/tests/string/strspn.c b/tests/string/strspn.c index cd9316fad7..c198a20bf0 100644 --- a/tests/string/strspn.c +++ b/tests/string/strspn.c @@ -1,6 +1,5 @@ #include #include -#include int main(void) { char *hello = "hello"; @@ -9,6 +8,4 @@ int main(void) { printf("%lu\n", strspn(hello, "hello")); // should be 5 printf("%lu\n", strspn(world, "wendy")); // should be 1 printf("%lu\n", strspn(banana, "apple")); // should be 0 - - return EXIT_SUCCESS; } diff --git a/tests/string/strstr.c b/tests/string/strstr.c index 1e9f38cf97..d36b4d915a 100644 --- a/tests/string/strstr.c +++ b/tests/string/strstr.c @@ -1,6 +1,5 @@ #include #include -#include int main(void) { printf("%s\n", strstr("In relibc we trust", "rust")); @@ -8,6 +7,4 @@ int main(void) { printf("%s\n", strstr("In relibc we trust", "bugs")); printf("%s\n", strstr("IN RELIBC WE TRUST", "rust")); printf("%s\n", strcasestr("IN RELIBC WE TRUST", "rust")); - - return EXIT_SUCCESS; } diff --git a/tests/string/strtok.c b/tests/string/strtok.c index cfa716fe7f..d2e066acb3 100644 --- a/tests/string/strtok.c +++ b/tests/string/strtok.c @@ -1,6 +1,5 @@ #include #include -#include int main(void) { char source[] = "I'd just like to interject for a moment. What you're referring to as Linux, " @@ -13,6 +12,4 @@ int main(void) { printf("_"); } } - - return EXIT_SUCCESS; } diff --git a/tests/string/strtok_r.c b/tests/string/strtok_r.c index 2abe530b0e..8873635c69 100644 --- a/tests/string/strtok_r.c +++ b/tests/string/strtok_r.c @@ -1,6 +1,5 @@ #include #include -#include int main(void) { char source[] = "I'd just like to interject for a moment. What you're referring to as Linux, " @@ -14,6 +13,4 @@ int main(void) { printf("_"); } } - - return EXIT_SUCCESS; } diff --git a/tests/time/asctime.c b/tests/time/asctime.c index 2624ec9b7b..f2e57da1a6 100644 --- a/tests/time/asctime.c +++ b/tests/time/asctime.c @@ -12,5 +12,4 @@ int main(void) { if (time_string == NULL || strcmp(time_string, "Thu Jan 1 00:00:00 1970\n") != 0) { return EXIT_FAILURE; } - return EXIT_SUCCESS; } diff --git a/tests/time/gmtime.c b/tests/time/gmtime.c index 38d0b8d347..09bc97e5ef 100644 --- a/tests/time/gmtime.c +++ b/tests/time/gmtime.c @@ -24,5 +24,4 @@ int main(void) { info->tm_gmtoff != expected.tm_gmtoff || strcmp(info->tm_zone, expected.tm_zone) != 0) { return EXIT_FAILURE; } - return EXIT_SUCCESS; } diff --git a/tests/time/time.c b/tests/time/time.c index 3c5aed66b7..24d7b28d34 100644 --- a/tests/time/time.c +++ b/tests/time/time.c @@ -22,6 +22,4 @@ int main(void) { perror("clock"); return EXIT_FAILURE; } - - return EXIT_SUCCESS; } diff --git a/tests/unistd/brk.c b/tests/unistd/brk.c index 5b4ffc1418..811644e28d 100644 --- a/tests/unistd/brk.c +++ b/tests/unistd/brk.c @@ -1,9 +1,7 @@ #include #include -#include int main(void) { int status = brk((void*)100); printf("brk exited with status code %d\n", status); - return EXIT_SUCCESS; } diff --git a/tests/unistd/chdir.c b/tests/unistd/chdir.c index eb8341eeb5..28178922e8 100644 --- a/tests/unistd/chdir.c +++ b/tests/unistd/chdir.c @@ -12,5 +12,4 @@ int main(void) { getcwd(cwd2, 4096); printf("final cwd: %s\n", cwd2); free(cwd2); - return EXIT_SUCCESS; } diff --git a/tests/unistd/dup.c b/tests/unistd/dup.c index 8a0ca9809e..0c7ff8ecb9 100644 --- a/tests/unistd/dup.c +++ b/tests/unistd/dup.c @@ -1,7 +1,6 @@ #include #include #include -#include int main(void) { creat("dup.out", 0777); @@ -14,5 +13,4 @@ int main(void) { dup2(fd3, 1); printf("hello fd %d", fd3); close(fd3); - return EXIT_SUCCESS; } diff --git a/tests/unistd/exec.c b/tests/unistd/exec.c index 97eae0fed9..43b10ddccb 100644 --- a/tests/unistd/exec.c +++ b/tests/unistd/exec.c @@ -1,10 +1,8 @@ #include #include -#include int main(void) { char* args[] = {"sh", "-c", "echo 'exec works :D'", NULL}; execv("/bin/sh", args); perror("execv"); - return EXIT_SUCCESS; } diff --git a/tests/unistd/fchdir.c b/tests/unistd/fchdir.c index b2b4b7d00d..9e3ab29b7e 100644 --- a/tests/unistd/fchdir.c +++ b/tests/unistd/fchdir.c @@ -1,7 +1,6 @@ #include #include #include -#include int main(void) { int fd = open("..", 0, 0); @@ -9,5 +8,4 @@ int main(void) { status = fchdir(fd); printf("fchdir exited with status code %d\n", status); close(fd); - return EXIT_SUCCESS; } diff --git a/tests/unistd/fsync.c b/tests/unistd/fsync.c index 0db9d00fcf..7f337f1caa 100644 --- a/tests/unistd/fsync.c +++ b/tests/unistd/fsync.c @@ -1,7 +1,6 @@ #include #include #include -#include int main(void) { int fd = open(".", 0, 0); @@ -9,5 +8,4 @@ int main(void) { status = fsync(fd); printf("fsync exited with status code %d\n", status); close(fd); - return EXIT_SUCCESS; } diff --git a/tests/unistd/ftruncate.c b/tests/unistd/ftruncate.c index df2212cfb3..7eb4f9822d 100644 --- a/tests/unistd/ftruncate.c +++ b/tests/unistd/ftruncate.c @@ -1,7 +1,6 @@ #include #include #include -#include int main(void) { int fd = creat("ftruncate.out", 0777); @@ -9,5 +8,4 @@ int main(void) { status = ftruncate(fd, 100); printf("ftruncate exited with status code %d\n", status); close(fd); - return EXIT_SUCCESS; } diff --git a/tests/unistd/getid.c b/tests/unistd/getid.c index e0719b4413..d2a2bf579c 100644 --- a/tests/unistd/getid.c +++ b/tests/unistd/getid.c @@ -1,6 +1,5 @@ #include #include -#include int main(void) { gid_t egid = getegid(); @@ -12,5 +11,4 @@ int main(void) { uid_t uid = getuid(); printf("egid: %d, euid: %d, gid: %d, pgid: %d, pid: %d, ppid %d, uid %d\n", egid, euid, gid, pgid, pid, ppid, uid); - return EXIT_SUCCESS; } diff --git a/tests/unistd/pathconf.c b/tests/unistd/pathconf.c index c878efb24e..5aeaee8b67 100644 --- a/tests/unistd/pathconf.c +++ b/tests/unistd/pathconf.c @@ -1,6 +1,5 @@ #include #include -#include #include #define PC(N) { \ @@ -30,5 +29,4 @@ int main(void) { PC(ALLOC_SIZE_MIN); PC(SYMLINK_MAX); PC(2_SYMLINKS); - return EXIT_SUCCESS; } diff --git a/tests/unistd/pipe.c b/tests/unistd/pipe.c index 320b3906d7..90dfa64641 100644 --- a/tests/unistd/pipe.c +++ b/tests/unistd/pipe.c @@ -67,5 +67,4 @@ int main(void) { return EXIT_SUCCESS; } - return EXIT_SUCCESS; } diff --git a/tests/unistd/rmdir.c b/tests/unistd/rmdir.c index 2af003c3fe..212ad48dab 100644 --- a/tests/unistd/rmdir.c +++ b/tests/unistd/rmdir.c @@ -1,11 +1,9 @@ #include #include #include -#include int main(void) { mkdir("foo", 0); int status = rmdir("foo"); printf("rmdir exited with status code %d\n", status); - return EXIT_SUCCESS; } diff --git a/tests/unistd/setid.c b/tests/unistd/setid.c index f267814d13..5a35bbb54f 100644 --- a/tests/unistd/setid.c +++ b/tests/unistd/setid.c @@ -4,7 +4,6 @@ #include #include #include -#include int main(void) { if( setpgid( getpid(), 0 ) == -1 ) { @@ -22,5 +21,4 @@ int main(void) { perror( "setreuid" ); } printf("%d has euid %d and uid %d\n", getpid(), geteuid(), getuid()); - return EXIT_SUCCESS; } diff --git a/tests/unistd/sleep.c b/tests/unistd/sleep.c index ab27aa303b..7aa46108c9 100644 --- a/tests/unistd/sleep.c +++ b/tests/unistd/sleep.c @@ -1,7 +1,6 @@ #include #include #include -#include int main(void) { sleep(2); @@ -11,5 +10,4 @@ int main(void) { struct timespec tm = {0, 10000}; nanosleep(&tm, NULL); perror("nanosleep"); - return EXIT_SUCCESS; } diff --git a/tests/unistd/sysconf.c b/tests/unistd/sysconf.c index 9aca5f4187..be64b647c6 100644 --- a/tests/unistd/sysconf.c +++ b/tests/unistd/sysconf.c @@ -1,6 +1,5 @@ #include #include -#include #include #define SC(N) { \ @@ -23,5 +22,4 @@ int main(void) { SC(TTY_NAME_MAX); SC(SYMLOOP_MAX); SC(HOST_NAME_MAX); - return EXIT_SUCCESS; } diff --git a/tests/unistd/write.c b/tests/unistd/write.c index e9af15ab7a..47cc4e0213 100644 --- a/tests/unistd/write.c +++ b/tests/unistd/write.c @@ -1,7 +1,5 @@ -#include #include int main(void) { write(STDOUT_FILENO, "Hello World!\n", 13); - return EXIT_SUCCESS; } diff --git a/tests/waitpid.c b/tests/waitpid.c index 5f94f5b7ca..e25011d89a 100644 --- a/tests/waitpid.c +++ b/tests/waitpid.c @@ -13,5 +13,4 @@ int main(void) { int stat_loc; waitpid(pid, &stat_loc, 0); } - return EXIT_SUCCESS; } diff --git a/tests/wchar/putwchar.c b/tests/wchar/putwchar.c index 0380d5ae33..db5e276acc 100644 --- a/tests/wchar/putwchar.c +++ b/tests/wchar/putwchar.c @@ -15,6 +15,4 @@ int main(void) { return EXIT_FAILURE; } } - - return EXIT_SUCCESS; }