projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
467cc9b
)
tests: tail-2/flush-initial: correct race avoidance code
author
Jim Meyering
<meyering@redhat.com>
Sun, 6 Sep 2009 18:00:14 +0000
(20:00 +0200)
committer
Jim Meyering
<meyering@redhat.com>
Sun, 6 Sep 2009 18:00:34 +0000
(20:00 +0200)
* tests/tail-2/flush-initial: Wait for the file to be nonempty,
not for the process. Based on a suggestion from Pádraig Brady.
tests/tail-2/flush-initial
patch
|
blob
|
history
diff --git
a/tests/tail-2/flush-initial
b/tests/tail-2/flush-initial
index
2deff84
..
515b29d
100755
(executable)
--- a/
tests/tail-2/flush-initial
+++ b/
tests/tail-2/flush-initial
@@
-28,9
+28,10
@@
echo line > in || fail=1
stdbuf --output=1K tail -f in > out &
tail_pid=$!
-# Wait for the backgrounded `tail' to start.
-while :; do
- env kill -0 $tail_pid && break
+# Wait for 1 second for the file to be flushed.
+for i in $(seq 10); do
+ test -s out && break
+ echo sleep .1s
sleep .1
done