summaryrefslogtreecommitdiffstats
path: root/usr.bin/tail
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-06-06 17:47:13 +0000
committerjlemon <jlemon@FreeBSD.org>2001-06-06 17:47:13 +0000
commit08bbb9b6f587aab8da4bf045d562e7ce4e578b42 (patch)
tree7a6de3f59fb8114c651ef238fcd3a079525c15f8 /usr.bin/tail
parentbf3a0c1bb10ffc87be85ae3e805b617e9d0e7cc9 (diff)
downloadFreeBSD-src-08bbb9b6f587aab8da4bf045d562e7ce4e578b42.zip
FreeBSD-src-08bbb9b6f587aab8da4bf045d562e7ce4e578b42.tar.gz
o If the file being tailed is moved back to the original location,
resume using kqueue to monitor it, if possible. o auto-clear the read filter on EOF; this is needed when tailing a FIFO.
Diffstat (limited to 'usr.bin/tail')
-rw-r--r--usr.bin/tail/forward.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c
index ffca06a..cd1980f 100644
--- a/usr.bin/tail/forward.c
+++ b/usr.bin/tail/forward.c
@@ -204,7 +204,7 @@ forward(fp, style, off, sbp)
n++;
}
EV_SET(&ev[n], fileno(fp), EVFILT_READ,
- EV_ADD | EV_ENABLE, 0, 0, 0);
+ EV_ADD | EV_ENABLE | EV_CLEAR, 0, 0, 0);
n++;
if (kevent(kq, ev, n, NULL, 0, &ts) < 0) {
@@ -251,6 +251,8 @@ forward(fp, style, off, sbp)
*sbp = sb2;
if (kq != -1)
action = ADD_EVENTS;
+ } else if (kq != -1) {
+ action = USE_KQUEUE;
}
}
break;
OpenPOWER on IntegriCloud