summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/efreet/efreet_base.c5
-rw-r--r--src/lib/elementary/elm_config.c28
-rw-r--r--src/lib/elput/elput_evdev.c11
-rw-r--r--src/modules/ecore_buffer/shm/ecore_buffer_shm.c15
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c19
5 files changed, 21 insertions, 57 deletions
diff --git a/src/lib/efreet/efreet_base.c b/src/lib/efreet/efreet_base.c
index 506d2e89a4..d510cde10e 100644
--- a/src/lib/efreet/efreet_base.c
+++ b/src/lib/efreet/efreet_base.c
@@ -311,9 +311,8 @@ efreet_dirs_init(void)
311#endif 311#endif
312 312
313 /* xdg_runtime_dir */ 313 /* xdg_runtime_dir */
314 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/"); 314 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
315 efl_vpath_file_do(file_obj); 315 "(:run:)/");
316 efl_vpath_file_wait(file_obj);
317 xdg_runtime_dir = eina_stringshare_add(efl_vpath_file_result_get(file_obj)); 316 xdg_runtime_dir = eina_stringshare_add(efl_vpath_file_result_get(file_obj));
318 efl_del(file_obj); 317 efl_del(file_obj);
319 318
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 58dd95e9e8..48330cdfcf 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -615,9 +615,6 @@ _elm_config_user_dir_snprintf(char *dst,
615 va_list ap; 615 va_list ap;
616 Efl_Vpath_File *file_obj; 616 Efl_Vpath_File *file_obj;
617 static int use_xdg_config = -1; 617 static int use_xdg_config = -1;
618 const char elmdir[] = "elementary";
619 const char elmdotdir[] = ".elementary";
620 const char *path = NULL;
621 618
622 if (use_xdg_config == -1) 619 if (use_xdg_config == -1)
623 { 620 {
@@ -625,26 +622,15 @@ _elm_config_user_dir_snprintf(char *dst,
625 else use_xdg_config = 0; 622 else use_xdg_config = 0;
626 } 623 }
627 if (use_xdg_config) 624 if (use_xdg_config)
628 { 625 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
629 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:config:)/"); 626 "(:config:)/elementary");
630 efl_vpath_file_do(file_obj);
631 efl_vpath_file_wait(file_obj);
632 path = efl_vpath_file_result_get(file_obj);
633 user_dir_len = eina_str_join_len
634 (dst, size, '/', path, strlen(path) - 1, elmdir, sizeof(elmdir) - 1);
635 efl_del(file_obj);
636 }
637 else 627 else
638 { 628 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
639 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:home:)/"); 629 "(:home:)/.elementary");
640 efl_vpath_file_do(file_obj); 630 eina_strlcpy(dst, efl_vpath_file_result_get(file_obj), size);
641 efl_vpath_file_wait(file_obj); 631 efl_del(file_obj);
642 path = efl_vpath_file_result_get(file_obj);
643 user_dir_len = eina_str_join_len
644 (dst, size, '/', path, strlen(path) - 1, elmdotdir, sizeof(elmdotdir) - 1);
645 efl_del(file_obj);
646 }
647 632
633 user_dir_len = strlen(dst);
648 off = user_dir_len + 1; 634 off = user_dir_len + 1;
649 if (off >= size) return off; 635 if (off >= size) return off;
650 dst[user_dir_len] = '/'; 636 dst[user_dir_len] = '/';
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 8067f24783..e29600ce50 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -60,21 +60,16 @@ _keyboard_modifiers_update(Elput_Keyboard *kbd, Elput_Seat *seat)
60static int 60static int
61_keyboard_fd_get(off_t size) 61_keyboard_fd_get(off_t size)
62{ 62{
63 const char *path;
64 Eina_Tmpstr *fullname; 63 Eina_Tmpstr *fullname;
65 long flags; 64 long flags;
66 int fd = 0; 65 int fd = 0;
67 char tmp[PATH_MAX];
68 Efl_Vpath_File *file_obj; 66 Efl_Vpath_File *file_obj;
69 67
70 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/"); 68 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
71 efl_vpath_file_do(file_obj); 69 "(:run:)/elput-keymap-XXXXXX");
72 efl_vpath_file_wait(file_obj); 70 fd = eina_file_mkstemp(efl_vpath_file_result_get(file_obj), &fullname);
73 path = efl_vpath_file_result_get(file_obj);
74 snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path);
75 efl_del(file_obj); 71 efl_del(file_obj);
76 72
77 fd = eina_file_mkstemp(tmp, &fullname);
78 if (fd < 0) return -1; 73 if (fd < 0) return -1;
79 74
80 flags = fcntl(fd, F_GETFD); 75 flags = fcntl(fd, F_GETFD);
diff --git a/src/modules/ecore_buffer/shm/ecore_buffer_shm.c b/src/modules/ecore_buffer/shm/ecore_buffer_shm.c
index be270a9cbf..4a36c72f2d 100644
--- a/src/modules/ecore_buffer/shm/ecore_buffer_shm.c
+++ b/src/modules/ecore_buffer/shm/ecore_buffer_shm.c
@@ -54,8 +54,6 @@ _ecore_buffer_shm_buffer_alloc(Ecore_Buffer_Module_Data bmdata, int width, int h
54{ 54{
55 Ecore_Buffer_Shm_Data* b; 55 Ecore_Buffer_Shm_Data* b;
56 char *name; 56 char *name;
57 static const char tmp[] = "ecore-buffer-shared-XXXXXX";
58 const char *path;
59 int fd, size, page_size; 57 int fd, size, page_size;
60 Efl_Vpath_File *file_obj; 58 Efl_Vpath_File *file_obj;
61 59
@@ -70,16 +68,11 @@ _ecore_buffer_shm_buffer_alloc(Ecore_Buffer_Module_Data bmdata, int width, int h
70 b->size = page_size * (((b->stride * b->h) + (page_size - 1)) / page_size); 68 b->size = page_size * (((b->stride * b->h) + (page_size - 1)) / page_size);
71 b->am_owner = EINA_TRUE; 69 b->am_owner = EINA_TRUE;
72 70
73 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/"); 71 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
74 efl_vpath_file_do(file_obj); 72 "(:run:)/ecore-buffer-shared-XXXXXX");
75 efl_vpath_file_wait(file_obj); 73 name = strdup(efl_vpath_file_result_get(file_obj));
76 path = efl_vpath_file_result_get(file_obj);
77 size = strlen(path) + sizeof(tmp);
78 name = malloc(size);
79 if (!name) goto err;
80 strcpy(name, path);
81 strcat(name, tmp);
82 efl_del(file_obj); 74 efl_del(file_obj);
75 if (!name) goto err;
83 76
84 fd = mkostemp(name, O_CLOEXEC); 77 fd = mkostemp(name, O_CLOEXEC);
85 if (fd < 0) goto err_fd; 78 if (fd < 0) goto err_fd;
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 05c7ec3945..529b6098f5 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -82,9 +82,6 @@ static struct wl_shm_pool *
82_shm_pool_make(struct wl_shm *shm, int size, void **data) 82_shm_pool_make(struct wl_shm *shm, int size, void **data)
83{ 83{
84 struct wl_shm_pool *pool; 84 struct wl_shm_pool *pool;
85 static const char tmp[] = "evas-wayland_shm-XXXXXX";
86 const char *path;
87 char *name;
88 int fd = 0; 85 int fd = 0;
89 Eina_Tmpstr *fullname; 86 Eina_Tmpstr *fullname;
90 Efl_Vpath_File *file_obj; 87 Efl_Vpath_File *file_obj;
@@ -95,26 +92,20 @@ _shm_pool_make(struct wl_shm *shm, int size, void **data)
95 if (!shm) return NULL; 92 if (!shm) return NULL;
96 93
97 /* create tmp file name */ 94 /* create tmp file name */
98 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/"); 95 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
99 efl_vpath_file_do(file_obj); 96 "(:run:)/evas-wayland_shm-XXXXXX");
100 efl_vpath_file_wait(file_obj); 97 fd = eina_file_mkstemp(efl_vpath_file_result_get(file_obj), &fullname);
101 path = efl_vpath_file_result_get(file_obj); 98 efl_del(file_obj);
102 if ((name = malloc(strlen(path) + sizeof(tmp)))) strcpy(name, path); 99
103 if (!name) return NULL;
104 strcat(name, tmp);
105
106 fd = eina_file_mkstemp(name, &fullname);
107 if (fd < 0) 100 if (fd < 0)
108 /* try to create tmp file */ 101 /* try to create tmp file */
109 /* if ((fd = mkstemp(name)) < 0) */ 102 /* if ((fd = mkstemp(name)) < 0) */
110 { 103 {
111 ERR("Could not create temporary file: %m"); 104 ERR("Could not create temporary file: %m");
112 free(name);
113 return NULL; 105 return NULL;
114 } 106 }
115 107
116 unlink(fullname); 108 unlink(fullname);
117 free(name);
118 eina_tmpstr_del(fullname); 109 eina_tmpstr_del(fullname);
119 110
120 /* try to truncate file to size */ 111 /* try to truncate file to size */