We switched from mkstemp to eina_file_mkstemp() but ended up unlinking
the template filename, which didn't exist on the filesystem.
char *path;
char tmp[PATH_MAX];
long flags;
+ Eina_Tmpstr *fullname;
if (!(path = getenv("XDG_RUNTIME_DIR")))
return -1;
snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path);
- fd = eina_file_mkstemp(tmp, NULL);
+ fd = eina_file_mkstemp(tmp, &fullname);
if (fd < 0) return -1;
flags = fcntl(fd, F_GETFD);
return -1;
}
- unlink(tmp);
+ unlink(fullname);
+ eina_tmpstr_del(fullname);
return fd;
}