travis-ci: run previously failed tests first, then slowest to fastest
[gitweb.git] / path.c
diff --git a/path.c b/path.c
index f28ace2963bb3f0f76af0e363add22ed73a5a2c9..3cd155e27dddee6774d48522945c0615f6207d8c 100644 (file)
--- a/path.c
+++ b/path.c
@@ -740,6 +740,18 @@ int adjust_shared_perm(const char *path)
        return 0;
 }
 
+void safe_create_dir(const char *dir, int share)
+{
+       if (mkdir(dir, 0777) < 0) {
+               if (errno != EEXIST) {
+                       perror(dir);
+                       exit(1);
+               }
+       }
+       else if (share && adjust_shared_perm(dir))
+               die(_("Could not make %s writable by group"), dir);
+}
+
 static int have_same_root(const char *path1, const char *path2)
 {
        int is_abs1, is_abs2;