summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2013-10-08 08:37:08 +0200
committerMichael Wallner <mike@php.net>2013-10-08 08:37:08 +0200
commitf32d2ac3aaa7d4af7c348b00ebebb9ae64955704 (patch)
tree8d0a737dc99273b2b3b600cff3b4c75501374719 /build
parent0117eb747e1b36a301d58fa29aa3ae48b5aa2ac7 (diff)
downloadphp-git-f32d2ac3aaa7d4af7c348b00ebebb9ae64955704.tar.gz
fix bug #51076 (race condition in shtool's mkdir -p)
Diffstat (limited to 'build')
-rwxr-xr-xbuild/shtool9
1 files changed, 8 insertions, 1 deletions
diff --git a/build/shtool b/build/shtool
index 684a01f5df..fc6ae1e6ef 100755
--- a/build/shtool
+++ b/build/shtool
@@ -1003,7 +1003,14 @@ mkdir )
if [ ".$opt_t" = .yes ]; then
echo "mkdir $pathcomp" 1>&2
fi
- mkdir $pathcomp || errstatus=$?
+ # See https://bugs.php.net/51076
+ # The fix is from Debian who have sent it
+ # upstream, too; but upstream seems dead.
+ mkdir $pathcomp || {
+ _errstatus=$?
+ [ -d "$pathcomp" ] || errstatus=${_errstatus}
+ unset _errstatus
+ }
if [ ".$opt_o" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown $opt_o $pathcomp" 1>&2