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:
parent
93c8aaf925
commit
821a980ab4
5
tail.c
5
tail.c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user