{
int fd = 0, blen = 0, len = 0;
char *path;
- char tmp[PATH_MAX];
+ char buf[PATH_MAX];
+ Eina_Tmpstr *tmpstr = NULL;
- blen = sizeof(tmp) - 1;
+ blen = sizeof(buf) - 1;
path = e_util_env_get("XDG_RUNTIME_DIR");
if (!path) return -1;
len = strlen(path);
if (len < blen)
{
- strncpy(tmp, path, len + 1);
- strncat(tmp, "/enlightenment_rsm_dummy_fdXXXXXX", 34);
+ strncpy(buf, path, len + 1);
+ strncat(buf, "/enlightenment_rsm_dummy_fdXXXXXX", 34);
E_FREE(path);
}
else
return -1;
}
- if ((fd = mkstemp(tmp)) < 0)
+ if ((fd = eina_file_mkstemp(buf, &tmpstr)) < 0)
return -1;
- unlink(tmp);
+ ecore_file_unlink(tmpstr);
+ eina_tmpstr_del(tmpstr);
return fd;
}