Define compat version of mkdtemp for systems lacking it

Solaris 9 doesn't have mkdtemp() so we need to emulate it for the
rsync transport implementation.  Since Solaris 9 is lacking this
function we can also reasonably assume it is not available on
Solaris 8 either.  The new Makfile definition NO_MKDTEMP can be
set to enable the git compat version.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Shawn O. Pearce
2007-10-20 16:03:49 -04:00
parent cfa5b2b7fa
commit ca5bb5d539
3 changed files with 21 additions and 0 deletions

8
compat/mkdtemp.c Normal file
View File

@ -0,0 +1,8 @@
#include "../git-compat-util.h"
char *gitmkdtemp(char *template)
{
if (!mktemp(template) || mkdir(template, 0700))
return NULL;
return template;
}