1
0
mirror of git://git.suckless.org/sbase synced 2024-12-22 23:13:44 +00:00

Respect exit status in tail(1)

There are more instances of this problem.
This commit is contained in:
sin 2014-11-20 22:51:34 +00:00
parent 93c8aaf925
commit 821a980ab4

5
tail.c
View File

@ -23,6 +23,7 @@ main(int argc, char *argv[])
FILE *fp;
void (*tail)(FILE *, const char *, long) = taketail;
char *lines;
int ret = 0;
ARGBEGIN {
case 'n':
@ -43,14 +44,14 @@ main(int argc, char *argv[])
for (; argc > 0; argc--, argv++) {
if (!(fp = fopen(argv[0], "r"))) {
weprintf("fopen %s:", argv[0]);
ret = 1;
continue;
}
tail(fp, argv[0], n);
fclose(fp);
}
}
return 0;
return ret;
}
static void