summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-02-09 08:58:03 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-02-09 09:17:38 -0600
commit2800038ee212de4588471bca5d0773599b93d470 (patch)
tree0e197be8f33085c7a6d130ec385db3ab3e180bc6
parent9540e96107f7f6f759c3a7ed51d90a8883fc2310 (diff)
downloadefl-2800038ee212de4588471bca5d0773599b93d470.tar.gz
Revert "vpath usage - simplify to bare minimum to make gustavo happy"
This reverts commit 2037474dc0fd2b360452f2a15abcbe533b57ca37. This causes the wayland_shm engine to seg fault immediately at startup when attempting to create shm buffers. Please make sure when committing changes to the wayland_shm engine to test on intel, exynos, and at least one platform without dmabuf capabilities - or using the EVAS_WAYLAND_SHM_DISABLE_DMABUF env var to disable dmabuf on intel or exynos. Anyone without the time or hardware to fully test changes to wayland_shm can submit a patch to phabricator and assign it to me so I can fully test it before landing.
-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.c16
5 files changed, 54 insertions, 21 deletions
diff --git a/src/lib/efreet/efreet_base.c b/src/lib/efreet/efreet_base.c
index d510cde10e..506d2e89a4 100644
--- a/src/lib/efreet/efreet_base.c
+++ b/src/lib/efreet/efreet_base.c
@@ -311,8 +311,9 @@ efreet_dirs_init(void)
#endif
/* xdg_runtime_dir */
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
- "(:run:)/");
+ file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/");
+ efl_vpath_file_do(file_obj);
+ efl_vpath_file_wait(file_obj);
xdg_runtime_dir = eina_stringshare_add(efl_vpath_file_result_get(file_obj));
efl_del(file_obj);
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 48330cdfcf..58dd95e9e8 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -615,6 +615,9 @@ _elm_config_user_dir_snprintf(char *dst,
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)
{
@@ -622,15 +625,26 @@ _elm_config_user_dir_snprintf(char *dst,
else use_xdg_config = 0;
}
if (use_xdg_config)
- file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS,
- "(:config:)/elementary");
+ {
+ 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);
+ }
else
- 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);
+ {
+ 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);
+ }
- user_dir_len = strlen(dst);
off = user_dir_len + 1;
if (off >= size) return off;
dst[user_dir_len] = '/';
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index e29600ce50..8067f24783 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -60,16 +60,21 @@ _keyboard_modifiers_update(Elput_Keyboard *kbd, Elput_Seat *seat)
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:)/elput-keymap-XXXXXX");
- fd = eina_file_mkstemp(efl_vpath_file_result_get(file_obj), &fullname);
+ 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);
efl_del(file_obj);
+ fd = eina_file_mkstemp(tmp, &fullname);
if (fd < 0) return -1;
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 4a36c72f2d..be270a9cbf 100644
--- a/src/modules/ecore_buffer/shm/ecore_buffer_shm.c
+++ b/src/modules/ecore_buffer/shm/ecore_buffer_shm.c
@@ -54,6 +54,8 @@ _ecore_buffer_shm_buffer_alloc(Ecore_Buffer_Module_Data bmdata, int width, int h
{
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;
@@ -68,11 +70,16 @@ _ecore_buffer_shm_buffer_alloc(Ecore_Buffer_Module_Data bmdata, int width, int h
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:)/ecore-buffer-shared-XXXXXX");
- name = strdup(efl_vpath_file_result_get(file_obj));
- efl_del(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);
+ size = strlen(path) + sizeof(tmp);
+ name = malloc(size);
if (!name) goto err;
+ strcpy(name, path);
+ strcat(name, tmp);
+ efl_del(file_obj);
fd = mkostemp(name, O_CLOEXEC);
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 3b9e7a525c..05c7ec3945 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -82,6 +82,8 @@ static struct wl_shm_pool *
_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;
@@ -93,11 +95,15 @@ _shm_pool_make(struct wl_shm *shm, int size, void **data)
if (!shm) return NULL;
/* create tmp file name */
- 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);
-
+ 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);
if (fd < 0)
/* try to create tmp file */
/* if ((fd = mkstemp(name)) < 0) */