summaryrefslogtreecommitdiffstats
path: root/usr.bin/tail
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-03-27 23:24:25 +0000
committerache <ache@FreeBSD.org>2001-03-27 23:24:25 +0000
commitb3c7f151dc919c7483d83c1796430f22376a7ca9 (patch)
tree88e78fe88f18dcf8762d4b8f5de04dd8385b95ba /usr.bin/tail
parentbb2fe3e83997fa63755384b3eb531b32bbfecbb1 (diff)
downloadFreeBSD-src-b3c7f151dc919c7483d83c1796430f22376a7ca9.zip
FreeBSD-src-b3c7f151dc919c7483d83c1796430f22376a7ca9.tar.gz
Restore part of my fix spammed in v1.23:
fseeko(file_size, SEEK_SET) -> fseek(0L, SEEK_END) 1) File may grows between operations, so fseeko to file_size may miss 2) 0L, SEEK_END is the same code using in tail in all other places
Diffstat (limited to 'usr.bin/tail')
-rw-r--r--usr.bin/tail/forward.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c
index ffca06a..f1f1118 100644
--- a/usr.bin/tail/forward.c
+++ b/usr.bin/tail/forward.c
@@ -302,7 +302,7 @@ rlines(fp, off, sbp)
}
/* Set the file pointer to reflect the length displayed. */
- if (fseeko(fp, sbp->st_size, SEEK_SET) == -1) {
+ if (fseek(fp, 0L, SEEK_END) == -1) {
ierr();
return;
}
OpenPOWER on IntegriCloud