From 15bef4ddb6d0223fd80b52c84e888a50a2910bd8 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 29 Apr 2002 08:23:06 +0000 Subject: (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. --- src/tail.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') 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]); -- cgit v1.2.3-70-g09d2