aboutsummaryrefslogtreecommitdiff
path: root/compat/mkdtemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/mkdtemp.c')
-rw-r--r--compat/mkdtemp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/compat/mkdtemp.c b/compat/mkdtemp.c
new file mode 100644
index 000000000..34d4b4981
--- /dev/null
+++ b/compat/mkdtemp.c
@@ -0,0 +1,8 @@
+#include "../git-compat-util.h"
+
+char *gitmkdtemp(char *template)
+{
+ if (!mktemp(template) || mkdir(template, 0700))
+ return NULL;
+ return template;
+}