]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
ignore errors due to races if a parallel mkdir.sh already
authorGiovanni Bechis <gbechis@apache.org>
Tue, 9 May 2023 21:58:27 +0000 (21:58 +0000)
committerGiovanni Bechis <gbechis@apache.org>
Tue, 9 May 2023 21:58:27 +0000 (21:58 +0000)
created the dir

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909707 13f79535-47bb-0310-9956-ffa450edef68

build/mkdir.sh

index 13683ffcab06b42d5f3e216718d858af2047e5c3..0c6a9ef5a881e6fa01ca5dcc8a8dc32035a8636f 100755 (executable)
@@ -38,7 +38,13 @@ for file in ${1+"$@"} ; do
                  continue ;;
         esac
         if test ! -d "$pathcomp"; then
-            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