From: Jim Meyering Date: Mon, 29 Apr 2002 08:23:06 +0000 (+0000) Subject: (tail_forever): Do not treat X-Git-Tag: SH-UTILS-2_0_12~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15bef4ddb6d0223fd80b52c84e888a50a2910bd8;p=thirdparty%2Fcoreutils.git (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. --- diff --git a/src/tail.c b/src/tail.c index 73b3ab717a..c759d48936 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]);