diff options
author | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-06-06 17:47:13 +0000 |
---|---|---|
committer | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-06-06 17:47:13 +0000 |
commit | a8fb4e28107460afc79057036d573379d1854baf (patch) | |
tree | 53557962842df1c710b98ffb133669ae56cd3532 | |
parent | 3b6e32b01eca489a24472a08ee753c0106c14bbc (diff) | |
download | src-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.c | 4 |
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; |