aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Lemon <jlemon@FreeBSD.org>2001-06-06 17:47:13 +0000
committerJonathan Lemon <jlemon@FreeBSD.org>2001-06-06 17:47:13 +0000
commita8fb4e28107460afc79057036d573379d1854baf (patch)
tree53557962842df1c710b98ffb133669ae56cd3532
parent3b6e32b01eca489a24472a08ee753c0106c14bbc (diff)
downloadsrc-a8fb4e28107460afc79057036d573379d1854baf.tar.gz
src-a8fb4e28107460afc79057036d573379d1854baf.zip
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.
Notes
Notes: svn path=/head/; revision=77823
-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 ffca06a93b17..cd1980f1e656 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;