You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by sf...@apache.org on 2012/05/19 00:21:58 UTC
svn commit: r1340286 - /apr/apr/trunk/build/mkdir.sh
Author: sf
Date: Fri May 18 22:21:58 2012
New Revision: 1340286
URL: http://svn.apache.org/viewvc?rev=1340286&view=rev
Log:
Make mkdir.sh save to use in parallel builds:
Don't fail if a formerly missing directory has been created by another process
in the meantime.
Modified:
apr/apr/trunk/build/mkdir.sh
Modified: apr/apr/trunk/build/mkdir.sh
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/mkdir.sh?rev=1340286&r1=1340285&r2=1340286&view=diff
==============================================================================
--- apr/apr/trunk/build/mkdir.sh (original)
+++ apr/apr/trunk/build/mkdir.sh Fri May 18 22:21:58 2012
@@ -28,7 +28,13 @@ for file in ${1+"$@"} ; do
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" || errstatus=$?
+ thiserrstatus=0
+ mkdir "$pathcomp" || thiserrstatus=$?
+ # ignore errors due to races if a parallel mkdir.sh already
+ # created the dir
+ if test $thiserrstatus != 0 && test ! -d "$pathcomp" ; then
+ errstatus=$thiserrstatus
+ fi
fi
pathcomp="$pathcomp/"
done