Skip to content

Commit

Permalink
tests: Use $(MKDIR_P) to avoid races.
Browse files Browse the repository at this point in the history
"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 <[email protected]>
Reviewed-by: Greg Rose <[email protected]>
  • Loading branch information
blp committed Dec 6, 2017
1 parent 081afa7 commit 0cc5425
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down

0 comments on commit 0cc5425

Please sign in to comment.