On 12/5/2017 4:27 PM, Ben Pfaff wrote:
"test -d x || mkdir x" has a race when invoked in parallel: it is possible
for two processes to both see that 'x' does not exist and both try to
create it, and if that happens then one of them will fail.  This avoids
the problem.

Signed-off-by: Ben Pfaff <b...@ovn.org>
---
  tests/automake.mk | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/automake.mk b/tests/automake.mk
index 7eed1064e82b..c5cc95251207 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -193,7 +193,7 @@ valgrind_wrappers = \
        tests/valgrind/test-type-props
$(valgrind_wrappers): tests/valgrind-wrapper.in
-       @test -d tests/valgrind || mkdir tests/valgrind
+       @$(MKDIR_P) tests/valgrind
        $(AM_V_GEN) sed -e 's,[@]wrap_program[@],$@,' \
                $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp && \
        chmod +x $@.tmp && \

Reviewed-by: Greg Rose <gvrose8...@gmail.com>

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to