summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-05 22:51:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-08-05 22:51:36 (GMT)
commita75163119c0f99cf3abff495c0fa35e55cd4cfa1 (patch)
tree627cc22d2f4e5bcb15635b7c57f44e316ba5e79a
parentde28459136810bc12d4fd380e02b7fb8b5b49421 (diff)
parentae25974de301ba1809f2d7f0219fcdd86d18cc1f (diff)
downloadgit-a75163119c0f99cf3abff495c0fa35e55cd4cfa1.zip
git-a75163119c0f99cf3abff495c0fa35e55cd4cfa1.tar.gz
git-a75163119c0f99cf3abff495c0fa35e55cd4cfa1.tar.bz2
Merge branch 'rs/mingw-tighten-mkstemp' into maint
mkstemp() emulation on Windows has been improved. source: <7265e37f-fd29-3579-b840-19a1df52a59f@web.de> * rs/mingw-tighten-mkstemp: mingw: avoid mktemp() in mkstemp() implementation
-rw-r--r--compat/mingw.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 2607de9..b550299 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1059,10 +1059,7 @@ char *mingw_mktemp(char *template)
int mkstemp(char *template)
{
- char *filename = mktemp(template);
- if (!filename)
- return -1;
- return open(filename, O_RDWR | O_CREAT, 0600);
+ return git_mkstemp_mode(template, 0600);
}
int gettimeofday(struct timeval *tv, void *tz)