A patch from Erik Meusel <erik@wh58-709.st.uni-magdeburg.de>

to fix the behavior of 'tail -f -n 0 FILE'
This commit is contained in:
Eric Andersen 2001-06-26 15:07:08 +00:00
parent 78b0e379d7
commit ce98c19dfe
2 changed files with 8 additions and 0 deletions

View File

@ -127,6 +127,10 @@ int tail_main(int argc, char **argv)
for (i = 0; i < nfiles; i++) {
if (fds[i] == -1)
continue;
if (!count) {
lseek(fds[i], 0, SEEK_END);
continue;
}
seen = 0;
if (show_headers || (!hide_headers && nfiles > 1))
printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]);

4
tail.c
View File

@ -127,6 +127,10 @@ int tail_main(int argc, char **argv)
for (i = 0; i < nfiles; i++) {
if (fds[i] == -1)
continue;
if (!count) {
lseek(fds[i], 0, SEEK_END);
continue;
}
seen = 0;
if (show_headers || (!hide_headers && nfiles > 1))
printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]);