We switched from mkstemp to eina_file_mkstemp() but ended up unlinking
the template filename, which didn't exist on the filesystem.
const char *path;
char *name;
int fd = 0;
+ Eina_Tmpstr *fullname;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
strcat(name, tmp);
- fd = eina_file_mkstemp(name, NULL);
+ fd = eina_file_mkstemp(name, &fullname);
if (fd < 0)
/* try to create tmp file */
/* if ((fd = mkstemp(name)) < 0) */
return NULL;
}
- unlink(name);
+ unlink(fullname);
free(name);
+ eina_tmpstr_del(fullname);
/* try to truncate file to size */
if (ftruncate(fd, size) < 0)