12 char *mkdtemp(char *template)
15 if (!mktemp(template)) return 0;
16 if (!mkdir(template, 0700)) return template;
17 if (errno != EEXIST) return 0;
18 /* this is safe because mktemp verified
19 * that we have a valid template string */
20 strcpy(template+strlen(template)-6, "XXXXXX");