diff -r 000000000000 -r adf633a3ae6f bl/mkdtemp.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bl/mkdtemp.c Sat Feb 18 17:08:22 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 */