summaryrefslogtreecommitdiff
path: root/src/win32/posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/win32/posix.c')
-rw-r--r--src/win32/posix.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/win32/posix.c b/src/win32/posix.c
index 0e9d3f0f4..aac56ce84 100644
--- a/src/win32/posix.c
+++ b/src/win32/posix.c
@@ -1,6 +1,7 @@
#include "posix.h"
#include "path.h"
#include <errno.h>
+#include <io.h>
int p_unlink(const char *path)
{
@@ -230,3 +231,19 @@ int p_snprintf(char *buffer, size_t count, const char *format, ...)
return r;
}
+
+int p_mkstemp(char *tmp_path)
+{
+ int r;
+
+#if defined(_MSC_VER)
+ r = _mktemp_s(tmp_path, GIT_PATH_MAX);
+#else
+ r = _mktemp(tmp_path);
+#endif
+
+ if (r != 0)
+ return GIT_EOSERR;
+
+ return p_creat(tmp_path, 0744);
+}