summaryrefslogtreecommitdiffstats
path: root/usr.bin/tail/read.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2009-06-05 09:08:53 +0000
committerbrian <brian@FreeBSD.org>2009-06-05 09:08:53 +0000
commit330bc8582df629e9fa4dccb68bbab181520d98a9 (patch)
treee543b101f94f862f5071b48f0a4c466e2afa6f25 /usr.bin/tail/read.c
parentc284a3411ae19dfa5dbf2a027bbbd7aa24ff1191 (diff)
downloadFreeBSD-src-330bc8582df629e9fa4dccb68bbab181520d98a9.zip
FreeBSD-src-330bc8582df629e9fa4dccb68bbab181520d98a9.tar.gz
Change the behaviour of -F slightly; it now persists (forever) in
trying to open files rather than giving up when it encounters an error. ENOENT errors are not reported. As a result, files that are moved away then recreated are not at risk of being 'lost' to tail. Files that are recreated and temporarily have unreadable permissions will be shown when they are fixed. This behaviour is consistent with the GNU version of tail but without the verbiage that goes with the GNU version. This change also fixes error messages accompanying -f and -F. They no longer report problems with (null)! MFC after: 3 weeks
Diffstat (limited to 'usr.bin/tail/read.c')
-rw-r--r--usr.bin/tail/read.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c
index d290ed4..14086e7 100644
--- a/usr.bin/tail/read.c
+++ b/usr.bin/tail/read.c
@@ -66,7 +66,7 @@ static const char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/6/93";
* the end.
*/
int
-bytes(FILE *fp, off_t off)
+bytes(FILE *fp, const char *fn, off_t off)
{
int ch, len, tlen;
char *ep, *p, *t;
@@ -84,7 +84,7 @@ bytes(FILE *fp, off_t off)
}
}
if (ferror(fp)) {
- ierr();
+ ierr(fn);
free(sp);
return 1;
}
@@ -136,7 +136,7 @@ bytes(FILE *fp, off_t off)
* the end.
*/
int
-lines(FILE *fp, off_t off)
+lines(FILE *fp, const char *fn, off_t off)
{
struct {
int blen;
@@ -178,7 +178,7 @@ lines(FILE *fp, off_t off)
}
}
if (ferror(fp)) {
- ierr();
+ ierr(fn);
rc = 1;
goto done;
}
OpenPOWER on IntegriCloud