diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-12-03 17:29:41 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-12-03 17:29:41 +0000 |
commit | a15c9ef1690e16cbd1f804b870b7e811214a5be2 (patch) | |
tree | fcda60db2faee2e540dd5e9e31db2a4e2732125b /lib/make | |
parent | d2ca5766ef557702cfb3c0eb3b1992ed820146b1 (diff) |
Protect 'mkdir scratchdir' against concurrent invocations from parallel makes.
This closes Cactus/441.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2476 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make')
-rw-r--r-- | lib/make/make.configuration | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/make/make.configuration b/lib/make/make.configuration index 1b416e1c..ebf21fc5 100644 --- a/lib/make/make.configuration +++ b/lib/make/make.configuration @@ -122,7 +122,8 @@ $(CONFIG)/cctki_version.h: $(CCTK_HOME)/Makefile $(CCTK_LIBDIR)/$(LIBNAME_PREFIX)%$(LIBNAME_SUFFIX): update @echo $(DIVIDER) @echo Checking status of $(notdir $@) - if [ ! -d $(SCRATCH_BUILD) ]; then $(MKDIR) $(MKDIRFLAGS) $(SCRATCH_BUILD) ; fi + # protect the following mkdir against parallel makes + if [ ! -d $(SCRATCH_BUILD) ]; then sleep 3; msg=`$(MKDIR) $(MKDIRFLAGS) $(SCRATCH_BUILD) 2>&1`; if [ -d $(SCRATCH_BUILD) ]; then exit 0; else echo "$$msg"; exit 1; fi; fi if [ ! -d $(BUILD_DIR) ]; then $(MKDIR) $(MKDIRFLAGS) $(BUILD_DIR) ; fi thorn_name=$(@:$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)%$(LIBNAME_SUFFIX)=%); \ if [ "$$thorn_name" = "Cactus" ] ; then src_dir=$(CCTK_HOME)/src ; \ |