summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-04-29 08:23:06 +0000
committerJim Meyering <jim@meyering.net>2002-04-29 08:23:06 +0000
commit15bef4ddb6d0223fd80b52c84e888a50a2910bd8 (patch)
tree3b9fb4536ba5a105f5c7517984e44d8a23691e8e /src
parent5ce88fe52521f00b1c14f5ce2caa086015151b95 (diff)
downloadcoreutils-15bef4ddb6d0223fd80b52c84e888a50a2910bd8.tar.xz
(tail_forever): Do not treat
max_n_unchanged_stats_between_opens specially (as if it were infinite) if it has its maximal value. Similarly for max_n_consecutive_size_changes_between_opens.
Diffstat (limited to 'src')
-rw-r--r--src/tail.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tail.c b/src/tail.c
index 73b3ab717..c759d4893 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -962,7 +962,8 @@ tail_forever (struct File_spec *f, int nfiles)
if (stats.st_size == f[i].size)
{
f[i].n_consecutive_size_changes = 0;
- if (++f[i].n_unchanged_stats > max_n_unchanged_stats_between_opens
+ if ((max_n_unchanged_stats_between_opens
+ <= f[i].n_unchanged_stats++)
&& follow_mode == Follow_name)
{
recheck (&f[i]);
@@ -971,14 +972,11 @@ tail_forever (struct File_spec *f, int nfiles)
continue;
}
- /* Size changed. */
- ++f[i].n_consecutive_size_changes;
-
/* Ensure that a file that's unlinked or moved aside, yet always
growing will be recognized as having been renamed. */
- if (follow_mode == Follow_name
- && (f[i].n_consecutive_size_changes
- > max_n_consecutive_size_changes_between_opens))
+ if ((max_n_consecutive_size_changes_between_opens
+ <= f[i].n_consecutive_size_changes++)
+ && follow_mode == Follow_name)
{
f[i].n_consecutive_size_changes = 0;
recheck (&f[i]);