8154326: bash >(...) construct causes race conditions

Reviewed-by: tbell, ihse
This commit is contained in:
Erik Joelsson 2016-04-22 10:48:12 +02:00
parent ee14387b53
commit f2c59f97ce
2 changed files with 3 additions and 3 deletions

@ -331,7 +331,7 @@ else # $(HAS_SPEC)=true
BUILD_LOG := $(OUTPUT_ROOT)/build.log
BUILD_TRACE_LOG := $(OUTPUT_ROOT)/build-trace-time.log
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2)
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) && wait
# Sanity check the spec file, so it matches this source code
define CheckSpecSanity

@ -706,10 +706,10 @@ endif
ExecuteWithLog = \
$(call LogCmdlines, Exececuting: [$(strip $2)]) \
$(call WriteFile, $2, $(strip $1).cmdline) \
( $(strip $2) > >($(TEE) $(strip $1).log) 2> >($(TEE) $(strip $1).log >&2) || \
( ( $(strip $2) > >($(TEE) $(strip $1).log) 2> >($(TEE) $(strip $1).log >&2) || \
( exitcode=$(DOLLAR)? && \
$(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(BUILD_OUTPUT)/%,%,$(strip $1))).log && \
exit $(DOLLAR)exitcode ) )
exit $(DOLLAR)exitcode ) ) && wait )
################################################################################
# Find lib dir for module