aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2021-12-08 12:11:53 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2021-12-08 12:11:53 -0500
commitdef992b66951abf1d1f6200d2af9e16ebd81365e (patch)
tree1ddd853bcdf162ab96921b925995defa72dcabf2
parent1489bafaf7a0107e307932ec7e6fff6a4f7d58df (diff)
parente03c8822c48bedfe6cc7fbd5a9382d9630de6494 (diff)
downloadegawk-def992b66951abf1d1f6200d2af9e16ebd81365e.tar.gz
egawk-def992b66951abf1d1f6200d2af9e16ebd81365e.tar.bz2
egawk-def992b66951abf1d1f6200d2af9e16ebd81365e.zip
Merge commit 'e03c8822c48bedfe6cc7fbd5a9382d9630de6494' into feature/readall to fix iolint test race condition.
-rw-r--r--test/ChangeLog7
-rw-r--r--test/iolint.awk2
-rw-r--r--test/iolint.ok2
3 files changed, 9 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 1a7b9175..034cc63b 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,10 @@
+2021-12-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * iolint.awk, iolint.ok: Reorder "cat" pipe/output file test to reduce
+ the likelihood of a race condition, since close operates on the
+ most-recently-used item. Thanks to Miguel Pineiro Jr.,
+ <mpj@pineiro.cc>, for suggesting the fix.
+
2021-11-21 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): stupid5, new test.
diff --git a/test/iolint.awk b/test/iolint.awk
index 042f743b..3ebaf436 100644
--- a/test/iolint.awk
+++ b/test/iolint.awk
@@ -49,8 +49,8 @@ BEGIN {
# `%.*s' used for output pipe and two-way pipe
# Not doing |& due to race condition and signals. sigh
cat = "cat"
- print "hello" | "cat"
print "/bin/cat \"$@\"" > "cat"
+ print "hello" | "cat"
print close("cat")
print close("cat")
fflush()
diff --git a/test/iolint.ok b/test/iolint.ok
index 7a165aa9..860bcfbf 100644
--- a/test/iolint.ok
+++ b/test/iolint.ok
@@ -20,9 +20,9 @@ gawk: iolint.awk:42: warning: `echo hello' used for input pipe and output file
0
0
gawk: iolint.awk:53: warning: `cat' used for output file and output pipe
-0
hello
0
+0
gawk: iolint.awk:67: warning: `eval $CMD_TO_RUN' used for input pipe and output pipe
0
0