[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Thu Jun 23 15:14:00 UTC 2016


The branch master has been updated
       via  70a56b914772e6b21cda2a5742817ae4bb7290f1 (commit)
      from  fe2d149119063ec3c89fd6db9af8a6970e3e6032 (commit)


- Log -----------------------------------------------------------------
commit 70a56b914772e6b21cda2a5742817ae4bb7290f1
Author: Sebastian Andrzej Siewior <sebastian at breakpoint.cc>
Date:   Fri Jun 10 20:04:51 2016 +0200

    utils/mkdir-p: check if dir exists also after mkdir failed
    
    with "make install -j8" it happens very often that two or more make
    instances are creating the same directory in parallel. As a result one
    instace creates the directory and second mkdir fails because the
    directory exists already (but it did not while testing for it earlier).
    
    Signed-off-by: Sebastian Andrzej Siewior <sebastian at breakpoint.cc>
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1204)

-----------------------------------------------------------------------

Summary of changes:
 util/mkdir-p.pl | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/util/mkdir-p.pl b/util/mkdir-p.pl
index 4f44266..3280602 100755
--- a/util/mkdir-p.pl
+++ b/util/mkdir-p.pl
@@ -33,6 +33,12 @@ sub do_mkdir_p {
     do_mkdir_p($parent);
   }
 
-  mkdir($dir, 0777) || die "Cannot create directory $dir: $!\n";
+  unless (mkdir($dir, 0777)) {
+    if (-d $dir) {
+      # We raced against another instance doing the same thing.
+      return;
+    }
+    die "Cannot create directory $dir: $!\n";
+  }
   print "created directory `$dir'\n";
 }


More information about the openssl-commits mailing list