]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tail: fix abuse2 test race
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 27 Jun 2021 01:23:52 +0000 (18:23 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 27 Jun 2021 01:40:26 +0000 (18:40 -0700)
* tests/tail-2/inotify-hash-abuse2.sh (fastpoll):
Fix race where tailed file â€˜f’ temporarily did not exist.

tests/tail-2/inotify-hash-abuse2.sh

index 2c40236afb4546f1f73be47fb6c5e191d6ddba4a..4b36b7a33d964c101277ae905c20a12ed9e2d9fb 100755 (executable)
@@ -33,8 +33,8 @@ for mode in '' '---disable-inotify'; do
 
   for i in $(seq 200); do
     kill -0 $pid || break;
-    mv f g
-    touch f
+    touch g
+    mv g f
   done
 
   # Ensure tail hasn't aborted