file names that are moved elsewhere within the same file system.
[bug introduced in coreutils-8.24]
+ `tail --follow` without --retry, will consistently exit with failure status
+ where inotify is not used, when all followed files become inaccessible.
+ [This bug was present in "the beginning".]
+
'tail -c 4096 /dev/zero' no longer loops forever.
[This bug was present in "the beginning".]
if (! any_live_files (f, n_files))
{
- error (0, 0, _("no files remaining"));
+ error (EXIT_FAILURE, 0, _("no files remaining"));
break;
}
sed '/inotify cannot be used/d' err > k && mv k err
compare exp err || fail=1
-# Between coreutils 8.34 and 9.5 inclusive, tail would have
-# waited indefinitely when a file was moved to the same file system
+# Between coreutils 8.34 and 9.5 inclusive, with inotify, tail would
+# have waited indefinitely when a file was moved to the same file system.
+# Also without inotify tail would have exited with success.
cleanup_() { kill $pid 2>/dev/null && wait $pid; }
-touch file || framework_failure_
-timeout 10 tail --follow=name file & pid=$!
-sleep .1 # Usually in inotify loop here
-mv file file.unfollow || framework_failure_
-wait $pid
-test $? = 1 || fail=1
+fastpoll='-s.1 --max-unchanged-stats=1' # speedup non inotify systems
+for inotify in '' '---disable-inotify'; do
+ touch file || framework_failure_
+ timeout 10 tail --follow=name $fastpoll file & pid=$!
+ sleep .1 # Usually in tail_forever{,_inotify}() here
+ mv file file.unfollow || framework_failure_
+ wait $pid
+ test $? = 1 || fail=1
+ rm -f file file.unfollow || framework_failure_
+done
Exit $fail
tail: cannot fstat 'standard input'
tail: error reading 'standard input'
tail: no files remaining
-tail: -
EOF
sed 's/\(tail:.*\):.*/\1/' errt > err || framework_failure_
compare exp err || fail=1