summaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-12-22 23:23:02 +0100
committerJim Meyering <meyering@redhat.com>2011-12-23 22:39:14 +0100
commit9c54c0a1d04ec243f9d118d679f31cd17b35ce6b (patch)
tree25bfac7d970d951301e05e15e3f12b6a2fa46db5 /src/Makefile.am
parent6e3299fcdb783b19552dbb2ceb0d012ce51a3501 (diff)
downloadcoreutils-9c54c0a1d04ec243f9d118d679f31cd17b35ce6b.tar.xz
tail: with -f, use polling when a file is on an FS of unknown type
Before, we would use inotify in that case, which would work as long as updates were taking place locally, but not at all when remote. Move hard-coded list of known remote FS types into a more maintainable table in stat.c, alongside the list of FS names and magic numbers. Generate a new is_local_fs_type function. * src/Makefile.am (fs-is-local.h): New rule, generated file. * src/extract-magic: Revamp to parse local/remote keyword after each magic number in src/stat.c's case statements. Accept new --local option. * src/.gitignore: Ignore the generated fs-is-local.h. * src/tail.c [HAVE_INOTIFY]: Include fs-is-local.h. (fremote) [HAVE_INOTIFY]: Use the new function in place of the switch stmt with hard-coded list of FS types. Emit a warning when processing a file on a file system of unknown type. * NEWS (Changes in behavior): Mention it. Suggested by Sven Breuner.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index f36e13803..c12b9d986 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -148,6 +148,7 @@ noinst_HEADERS = \
fiemap.h \
find-mount-point.h \
fs.h \
+ fs-is-local.h \
group-list.h \
ioblksize.h \
ls.h \
@@ -597,6 +598,14 @@ fs-kernel-magic: Makefile
| LC_ALL=C sort \
> $@-t && mv $@-t $@
+BUILT_SOURCES += fs-is-local.h
+fs-is-local.h: stat.c extract-magic
+ $(AM_V_GEN)rm -f $@
+ $(AM_V_at)$(PERL) $(srcdir)/extract-magic --local $(srcdir)/stat.c \
+ > $@t
+ $(AM_V_at)chmod a-w $@t
+ $(AM_V_at)mv $@t $@
+
BUILT_SOURCES += fs.h
fs.h: stat.c extract-magic
$(AM_V_GEN)rm -f $@