test: fix build warnings for most tests

Let rsync.c continue to warn, it's not complete ...

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-10-03 12:22:33 +02:00
1 parent 75139cdf3c
commit ef4a8691d3
4 files changed
+16 -13

No files matched your search

+4
View File
@@ -17,12 +17,16 @@ static struct stat before, after;
static void sigterm_handler(int signo) static void sigterm_handler(int signo)
{ {
(void)signo;
PRINT("Exiting ...\n"); PRINT("Exiting ...\n");
remove(PIDFILE); remove(PIDFILE);
} }
static void sigalrm_handler(int signo) static void sigalrm_handler(int signo)
{ {
(void)signo;
PRINT("Calling pidfile(%s)\n", pidfile_arg ?: "NULL"); PRINT("Calling pidfile(%s)\n", pidfile_arg ?: "NULL");
if (pidfile(pidfile_arg)) if (pidfile(pidfile_arg))
err(1, "failed creating1 %s", pidfile_arg); err(1, "failed creating1 %s", pidfile_arg);
+4 -5
View File
@@ -13,24 +13,23 @@
int main(void) int main(void)
{ {
int ret;
FILE *fp;
char buf[80] = ""; char buf[80] = "";
FILE *fp;
printf("Before tempfile():\n"); printf("Before tempfile():\n");
ret = system("ls -lrt " _PATH_TMP " | tail -3"); system("ls -lrt " _PATH_TMP " | tail -3");
fp = tempfile(); fp = tempfile();
fail_unless(fp != NULL); fail_unless(fp != NULL);
ret = fputs(READBACK, fp); fputs(READBACK, fp);
rewind(fp); rewind(fp);
if (fgets(buf, sizeof(buf), fp)) if (fgets(buf, sizeof(buf), fp))
fprintf(stderr, "\nRead-back from tempfile: %s", buf); fprintf(stderr, "\nRead-back from tempfile: %s", buf);
fail_unless(!strcmp(buf, READBACK)); fail_unless(!strcmp(buf, READBACK));
printf("\nAfter tempfile(), should be same list:\n"); 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); return fclose(fp);
} }
+7 -7
View File
@@ -11,13 +11,13 @@ int main(void)
int result = 0; int result = 0;
size_t i; size_t i;
struct tc test[] = { struct tc test[] = {
{ "executable", 1 }, { "executable", 1, 0 },
{ "executable -h", 1 }, { "executable -h", 1, 0 },
{ "executable-link", 1 }, { "executable-link", 1, 0 },
{ "regular", 0 }, { "regular", 0, 0 },
{ "ls", 1 }, { "ls", 1, 0 },
{ "/usr/bin/which", 1 }, { "/usr/bin/which", 1, 0 },
{ NULL, 0 } { NULL, 0, 0 }
}; };
setenv("PATH", "data/which:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin", 1); setenv("PATH", "data/which:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin", 1);
+1 -1
View File
@@ -4,7 +4,7 @@
#include "check.h" #include "check.h"
int main(int argc, char *argv[]) int main(void)
{ {
int chan[2]; int chan[2];
int status; int status;