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>
char *gitmkdtemp(char *template)
{
- if (!*mktemp(template) || mkdir(template, 0700))
- return NULL;
- return template;
+ return git_mkdtemp(template);
}