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;
|
FILE *fp;
|
||||||
void (*tail)(FILE *, const char *, long) = taketail;
|
void (*tail)(FILE *, const char *, long) = taketail;
|
||||||
char *lines;
|
char *lines;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
case 'n':
|
case 'n':
|
||||||
|
@ -43,14 +44,14 @@ main(int argc, char *argv[])
|
||||||
for (; argc > 0; argc--, argv++) {
|
for (; argc > 0; argc--, argv++) {
|
||||||
if (!(fp = fopen(argv[0], "r"))) {
|
if (!(fp = fopen(argv[0], "r"))) {
|
||||||
weprintf("fopen %s:", argv[0]);
|
weprintf("fopen %s:", argv[0]);
|
||||||
|
ret = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
tail(fp, argv[0], n);
|
tail(fp, argv[0], n);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user