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
2021-10-03 12:22:33 +02:00
parent 75139cdf3c
commit ef4a8691d3
4 changed files with 16 additions and 13 deletions
+4
View File
@@ -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);
+4 -5
View File
@@ -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);
}
+7 -7
View File
@@ -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);
+1 -1
View File
@@ -4,7 +4,7 @@
#include "check.h"
int main(int argc, char *argv[])
int main(void)
{
int chan[2];
int status;