aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/tail/forward.c
diff options
context:
space:
mode:
authorPaul Saab <ps@FreeBSD.org>2005-08-26 08:15:57 +0000
committerPaul Saab <ps@FreeBSD.org>2005-08-26 08:15:57 +0000
commit13829828e786a241aa4594ab5bf6ee05ebfc8762 (patch)
tree10d3e3f33b7fcea30e9d24332d948d583f4599b6 /usr.bin/tail/forward.c
parent8c190069a2b0c14d04bb436f1a08c281fcdccdd6 (diff)
downloadsrc-13829828e786a241aa4594ab5bf6ee05ebfc8762.tar.gz
src-13829828e786a241aa4594ab5bf6ee05ebfc8762.zip
Unbreak tail -f on non-local filesystems.
Notes
Notes: svn path=/head/; revision=149485
Diffstat (limited to 'usr.bin/tail/forward.c')
-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 1a3c6580714d..e8f3aaff2ada 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,