From: René Scharfe Date: Sat, 6 Dec 2025 13:27:47 +0000 (+0100) Subject: compat: use git_mkdtemp() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ecd3590a3052820eeb3f1d6764584c537b68938;p=thirdparty%2Fgit.git compat: use git_mkdtemp() A file might appear at the path returned by mktemp(3) before we call mkdir(2). Use the more robust git_mkdtemp() instead, which retries a number of times and doesn't need to call lstat(2). Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- diff --git a/compat/mkdtemp.c b/compat/mkdtemp.c index 1136119592..fcdd4e01e1 100644 --- a/compat/mkdtemp.c +++ b/compat/mkdtemp.c @@ -2,7 +2,5 @@ char *gitmkdtemp(char *template) { - if (!*mktemp(template) || mkdir(template, 0700)) - return NULL; - return template; + return git_mkdtemp(template); }