From ef4a8691d3ac360df2f9a59dcc7a702d7e77bfd5 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 3 Oct 2021 11:48:20 +0200 Subject: [PATCH] test: fix build warnings for most tests Let rsync.c continue to warn, it's not complete ... Signed-off-by: Joachim Wiberg --- test/pidfile.c | 4 ++++ test/tempfile.c | 9 ++++----- test/which.c | 14 +++++++------- test/yorn.c | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/test/pidfile.c b/test/pidfile.c index 9c086f1..a627dc7 100644 --- a/test/pidfile.c +++ b/test/pidfile.c @@ -17,12 +17,16 @@ static struct stat before, after; static void sigterm_handler(int signo) { + (void)signo; + PRINT("Exiting ...\n"); remove(PIDFILE); } static void sigalrm_handler(int signo) { + (void)signo; + PRINT("Calling pidfile(%s)\n", pidfile_arg ?: "NULL"); if (pidfile(pidfile_arg)) err(1, "failed creating1 %s", pidfile_arg); diff --git a/test/tempfile.c b/test/tempfile.c index f52b916..9c72f76 100644 --- a/test/tempfile.c +++ b/test/tempfile.c @@ -13,24 +13,23 @@ int main(void) { - int ret; - FILE *fp; char buf[80] = ""; + FILE *fp; printf("Before tempfile():\n"); - ret = system("ls -lrt " _PATH_TMP " | tail -3"); + system("ls -lrt " _PATH_TMP " | tail -3"); fp = tempfile(); fail_unless(fp != NULL); - ret = fputs(READBACK, fp); + fputs(READBACK, fp); rewind(fp); if (fgets(buf, sizeof(buf), fp)) fprintf(stderr, "\nRead-back from tempfile: %s", buf); fail_unless(!strcmp(buf, READBACK)); printf("\nAfter tempfile(), should be same list:\n"); - ret = system("ls -lrt " _PATH_TMP " | tail -3"); + system("ls -lrt " _PATH_TMP " | tail -3"); return fclose(fp); } diff --git a/test/which.c b/test/which.c index a610844..8e8d8c8 100644 --- a/test/which.c +++ b/test/which.c @@ -11,13 +11,13 @@ int main(void) int result = 0; size_t i; struct tc test[] = { - { "executable", 1 }, - { "executable -h", 1 }, - { "executable-link", 1 }, - { "regular", 0 }, - { "ls", 1 }, - { "/usr/bin/which", 1 }, - { NULL, 0 } + { "executable", 1, 0 }, + { "executable -h", 1, 0 }, + { "executable-link", 1, 0 }, + { "regular", 0, 0 }, + { "ls", 1, 0 }, + { "/usr/bin/which", 1, 0 }, + { NULL, 0, 0 } }; setenv("PATH", "data/which:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin", 1); diff --git a/test/yorn.c b/test/yorn.c index bf80a15..387cad2 100644 --- a/test/yorn.c +++ b/test/yorn.c @@ -4,7 +4,7 @@ #include "check.h" -int main(int argc, char *argv[]) +int main(void) { int chan[2]; int status;