diff -r 000000000000 -r 6a13fe0fc19e bl/mkdtemp.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bl/mkdtemp.c Mon Jan 30 00:36:31 2012 +0000 @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include +#include "mkdtemp.h" + +#if !HAVE_G_MKDTEMP +char *g_mkdtemp(char *template) +{ +#if !defined(WIN32) && HAVE_MKDTEMP + return mkdtemp(template); +#else + char *s; + for(;;) + { + s=g_strdup(template); + mktemp(s); + if (!*s) + { + g_free(s); + errno=EEXIST; + return NULL; + } + if (g_mkdir(s,0700)>=0) + { + strcpy(template,s); + g_free(s); + return template; + } + g_free(s); + } +#endif /* !defined(WIN32) && HAVE_MKDTEMP */ +} +#endif /* !HAVE_G_MKDTEMP */