if (!__mktemp(template)) return 0;
if (!mkdir(template, 0700)) return template;
if (errno != EEXIST) return 0;
if (!__mktemp(template)) return 0;
if (!mkdir(template, 0700)) return template;
if (errno != EEXIST) return 0;
* that we have a valid template string */
strcpy(template+strlen(template)-6, "XXXXXX");
}
* that we have a valid template string */
strcpy(template+strlen(template)-6, "XXXXXX");
}