#endif
/* xdg_runtime_dir */
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/");
- efl_vpath_file_do(file_obj);
- efl_vpath_file_wait(file_obj);
+ file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
+ "(:run:)/");
xdg_runtime_dir = eina_stringshare_add(efl_vpath_file_result_get(file_obj));
efl_del(file_obj);
va_list ap;
Efl_Vpath_File *file_obj;
static int use_xdg_config = -1;
- const char elmdir[] = "elementary";
- const char elmdotdir[] = ".elementary";
- const char *path = NULL;
if (use_xdg_config == -1)
{
else use_xdg_config = 0;
}
if (use_xdg_config)
- {
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:config:)/");
- efl_vpath_file_do(file_obj);
- efl_vpath_file_wait(file_obj);
- path = efl_vpath_file_result_get(file_obj);
- user_dir_len = eina_str_join_len
- (dst, size, '/', path, strlen(path) - 1, elmdir, sizeof(elmdir) - 1);
- efl_del(file_obj);
- }
+ file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
+ "(:config:)/elementary");
else
- {
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:home:)/");
- efl_vpath_file_do(file_obj);
- efl_vpath_file_wait(file_obj);
- path = efl_vpath_file_result_get(file_obj);
- user_dir_len = eina_str_join_len
- (dst, size, '/', path, strlen(path) - 1, elmdotdir, sizeof(elmdotdir) - 1);
- efl_del(file_obj);
- }
+ file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
+ "(:home:)/.elementary");
+ eina_strlcpy(dst, efl_vpath_file_result_get(file_obj), size);
+ efl_del(file_obj);
+ user_dir_len = strlen(dst);
off = user_dir_len + 1;
if (off >= size) return off;
dst[user_dir_len] = '/';
static int
_keyboard_fd_get(off_t size)
{
- const char *path;
Eina_Tmpstr *fullname;
long flags;
int fd = 0;
- char tmp[PATH_MAX];
Efl_Vpath_File *file_obj;
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/");
- efl_vpath_file_do(file_obj);
- efl_vpath_file_wait(file_obj);
- path = efl_vpath_file_result_get(file_obj);
- snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path);
+ file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
+ "(:run:)/elput-keymap-XXXXXX");
+ fd = eina_file_mkstemp(efl_vpath_file_result_get(file_obj), &fullname);
efl_del(file_obj);
- fd = eina_file_mkstemp(tmp, &fullname);
if (fd < 0) return -1;
flags = fcntl(fd, F_GETFD);
{
Ecore_Buffer_Shm_Data* b;
char *name;
- static const char tmp[] = "ecore-buffer-shared-XXXXXX";
- const char *path;
int fd, size, page_size;
Efl_Vpath_File *file_obj;
b->size = page_size * (((b->stride * b->h) + (page_size - 1)) / page_size);
b->am_owner = EINA_TRUE;
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/");
- efl_vpath_file_do(file_obj);
- efl_vpath_file_wait(file_obj);
- path = efl_vpath_file_result_get(file_obj);
- size = strlen(path) + sizeof(tmp);
- name = malloc(size);
- if (!name) goto err;
- strcpy(name, path);
- strcat(name, tmp);
+ file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
+ "(:run:)/ecore-buffer-shared-XXXXXX");
+ name = strdup(efl_vpath_file_result_get(file_obj));
efl_del(file_obj);
+ if (!name) goto err;
fd = mkostemp(name, O_CLOEXEC);
if (fd < 0) goto err_fd;
_shm_pool_make(struct wl_shm *shm, int size, void **data)
{
struct wl_shm_pool *pool;
- static const char tmp[] = "evas-wayland_shm-XXXXXX";
- const char *path;
- char *name;
int fd = 0;
Eina_Tmpstr *fullname;
Efl_Vpath_File *file_obj;
if (!shm) return NULL;
/* create tmp file name */
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/");
- efl_vpath_file_do(file_obj);
- efl_vpath_file_wait(file_obj);
- path = efl_vpath_file_result_get(file_obj);
- if ((name = malloc(strlen(path) + sizeof(tmp)))) strcpy(name, path);
- if (!name) return NULL;
- strcat(name, tmp);
-
- fd = eina_file_mkstemp(name, &fullname);
+ file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
+ "(:run:)/evas-wayland_shm-XXXXXX");
+ fd = eina_file_mkstemp(efl_vpath_file_result_get(file_obj), &fullname);
+ efl_del(file_obj);
+
if (fd < 0)
/* try to create tmp file */
/* if ((fd = mkstemp(name)) < 0) */
{
ERR("Could not create temporary file: %m");
- free(name);
return NULL;
}
unlink(fullname);
- free(name);
eina_tmpstr_del(fullname);
/* try to truncate file to size */