mirror of
https://github.com/git/git.git
synced 2026-01-10 10:13:33 +00:00
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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e1ecf0dd68
commit
5ecd3590a3
@@ -2,7 +2,5 @@
|
|||||||
|
|
||||||
char *gitmkdtemp(char *template)
|
char *gitmkdtemp(char *template)
|
||||||
{
|
{
|
||||||
if (!*mktemp(template) || mkdir(template, 0700))
|
return git_mkdtemp(template);
|
||||||
return NULL;
|
|
||||||
return template;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user