summaryrefslogtreecommitdiffstats
path: root/usr.bin/tail
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2005-08-26 08:15:57 +0000
committerps <ps@FreeBSD.org>2005-08-26 08:15:57 +0000
commita234fe9966e361cc850871dc6ffa4d598817ebbe (patch)
tree10d3e3f33b7fcea30e9d24332d948d583f4599b6 /usr.bin/tail
parent534105e83bf98da8edf41cd5bb9cec288c35ff15 (diff)
downloadFreeBSD-src-a234fe9966e361cc850871dc6ffa4d598817ebbe.zip
FreeBSD-src-a234fe9966e361cc850871dc6ffa4d598817ebbe.tar.gz
Unbreak tail -f on non-local filesystems.
Diffstat (limited to 'usr.bin/tail')
-rw-r--r--usr.bin/tail/forward.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c
index 1a3c658..e8f3aaf 100644
--- a/usr.bin/tail/forward.c
+++ b/usr.bin/tail/forward.c
@@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$");
static const char sccsid[] = "@(#)forward.c 8.1 (Berkeley) 6/6/93";
#endif
+#include <sys/param.h>
+#include <sys/mount.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -267,6 +269,7 @@ set_events(file_info_t *files)
int i, n = 0;
file_info_t *file;
struct timespec ts;
+ struct statfs sf;
ts.tv_sec = 0;
ts.tv_nsec = 0;
@@ -275,6 +278,13 @@ set_events(file_info_t *files)
for (i = 0, file = files; i < no_files; i++, file++) {
if (! file->fp)
continue;
+
+ if (fstatfs(fileno(file->fp), &sf) == 0 &&
+ (sf.f_flags & MNT_LOCAL) == 0) {
+ action = USE_SLEEP;
+ return;
+ }
+
if (Fflag && fileno(file->fp) != STDIN_FILENO) {
EV_SET(&ev[n], fileno(file->fp), EVFILT_VNODE,
EV_ADD | EV_ENABLE | EV_CLEAR,
OpenPOWER on IntegriCloud