changeset 2048:6743a8e0cab7 jdk-9+116

8154326: bash >(...) construct causes race conditions Reviewed-by: tbell, ihse
author erikj
date Fri, 22 Apr 2016 10:48:12 +0200
parents 81f1bcda3918
children 3d849638f2f7 bd32264e4108 c3efe6acb2ae 29effd8b21b5
files make/InitSupport.gmk make/common/MakeBase.gmk
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/make/InitSupport.gmk	Thu Apr 21 13:36:00 2016 -0700
+++ b/make/InitSupport.gmk	Fri Apr 22 10:48:12 2016 +0200
@@ -331,7 +331,7 @@
   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
--- a/make/common/MakeBase.gmk	Thu Apr 21 13:36:00 2016 -0700
+++ b/make/common/MakeBase.gmk	Fri Apr 22 10:48:12 2016 +0200
@@ -706,10 +706,10 @@
 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