diff --git a/src/tail.c b/src/tail.c index 2582b9d..dae5bc9 100644 --- a/src/tail.c +++ b/src/tail.c @@ -864,6 +864,8 @@ recheck (struct File_spec *f, bool blocking) unreadable (perms), and later becomes readable again and can be seen to be the same file (dev/ino). Otherwise, tail prints the entire contents of the file when it becomes readable. */ + ok = true; + f->errnum = 0; error (0, f->errnum, _("%s has become inaccessible"), quote (pretty_name (f))); } @@ -915,6 +917,8 @@ recheck (struct File_spec *f, bool blocking) } else { + if (new_stats.st_size > 0) { + (void) dump_remainder (pretty_name (f), f->fd, COPY_TO_EOF); /* Close the old one. */ close_fd (f->fd, pretty_name (f)); @@ -925,6 +929,7 @@ recheck (struct File_spec *f, bool blocking) quote (pretty_name (f))); } } + } else { if (f->fd == -1)