aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/ChangeLog6
-rw-r--r--test/functab4.awk9
2 files changed, 12 insertions, 3 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index b4ba26ff..39d6ae2c 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2020-01-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * functab4.awk: Code changes to avoid race conditions
+ calling stat on the test directory. Thanks to
+ Michal Jaegermann and Andrew J. Schorr.
+
2020-01-23 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): New test, symtab11.
diff --git a/test/functab4.awk b/test/functab4.awk
index 196fcc6d..3be971f3 100644
--- a/test/functab4.awk
+++ b/test/functab4.awk
@@ -9,11 +9,14 @@ BEGIN {
f = FUNCTAB["foo"]
@f()
- ret1 = stat(".", data1)
- print "ret1 =", ret1
+ # Do the two stats one after the other, and use ".." instead
+ # of "." to avoid race conditions seen using ".".
+ ret1 = stat("..", data1)
f = "stat"
- ret2 = @f(".", data2)
+ ret2 = @f("..", data2)
+
+ print "ret1 =", ret1
print "ret2 =", ret2
problem = 0