summaryrefslogtreecommitdiff
path: root/src
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 /src
parent9540e96107f7f6f759c3a7ed51d90a8883fc2310 (diff)
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.
Diffstat (limited to 'src')
-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)
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, 314 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/");
315 "(:run:)/"); 315 efl_vpath_file_do(file_obj);
316 efl_vpath_file_wait(file_obj);
316 xdg_runtime_dir = eina_stringshare_add(efl_vpath_file_result_get(file_obj)); 317 xdg_runtime_dir = eina_stringshare_add(efl_vpath_file_result_get(file_obj));
317 efl_del(file_obj); 318 efl_del(file_obj);
318 319
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,
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;
618 621
619 if (use_xdg_config == -1) 622 if (use_xdg_config == -1)
620 { 623 {
@@ -622,15 +625,26 @@ _elm_config_user_dir_snprintf(char *dst,
622 else use_xdg_config = 0; 625 else use_xdg_config = 0;
623 } 626 }
624 if (use_xdg_config) 627 if (use_xdg_config)
625 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, 628 {
626 "(:config:)/elementary"); 629 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:config:)/");
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 }
627 else 637 else
628 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, 638 {
629 "(:home:)/.elementary"); 639 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:home:)/");
630 eina_strlcpy(dst, efl_vpath_file_result_get(file_obj), size); 640 efl_vpath_file_do(file_obj);
631 efl_del(file_obj); 641 efl_vpath_file_wait(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 }
632 647
633 user_dir_len = strlen(dst);
634 off = user_dir_len + 1; 648 off = user_dir_len + 1;
635 if (off >= size) return off; 649 if (off >= size) return off;
636 dst[user_dir_len] = '/'; 650 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)
60static int 60static int
61_keyboard_fd_get(off_t size) 61_keyboard_fd_get(off_t size)
62{ 62{
63 const char *path;
63 Eina_Tmpstr *fullname; 64 Eina_Tmpstr *fullname;
64 long flags; 65 long flags;
65 int fd = 0; 66 int fd = 0;
67 char tmp[PATH_MAX];
66 Efl_Vpath_File *file_obj; 68 Efl_Vpath_File *file_obj;
67 69
68 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, 70 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/");
69 "(:run:)/elput-keymap-XXXXXX"); 71 efl_vpath_file_do(file_obj);
70 fd = eina_file_mkstemp(efl_vpath_file_result_get(file_obj), &fullname); 72 efl_vpath_file_wait(file_obj);
73 path = efl_vpath_file_result_get(file_obj);
74 snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path);
71 efl_del(file_obj); 75 efl_del(file_obj);
72 76
77 fd = eina_file_mkstemp(tmp, &fullname);
73 if (fd < 0) return -1; 78 if (fd < 0) return -1;
74 79
75 flags = fcntl(fd, F_GETFD); 80 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
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;
57 int fd, size, page_size; 59 int fd, size, page_size;
58 Efl_Vpath_File *file_obj; 60 Efl_Vpath_File *file_obj;
59 61
@@ -68,11 +70,16 @@ _ecore_buffer_shm_buffer_alloc(Ecore_Buffer_Module_Data bmdata, int width, int h
68 b->size = page_size * (((b->stride * b->h) + (page_size - 1)) / page_size); 70 b->size = page_size * (((b->stride * b->h) + (page_size - 1)) / page_size);
69 b->am_owner = EINA_TRUE; 71 b->am_owner = EINA_TRUE;
70 72
71 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, 73 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/");
72 "(:run:)/ecore-buffer-shared-XXXXXX"); 74 efl_vpath_file_do(file_obj);
73 name = strdup(efl_vpath_file_result_get(file_obj)); 75 efl_vpath_file_wait(file_obj);
74 efl_del(file_obj); 76 path = efl_vpath_file_result_get(file_obj);
77 size = strlen(path) + sizeof(tmp);
78 name = malloc(size);
75 if (!name) goto err; 79 if (!name) goto err;
80 strcpy(name, path);
81 strcat(name, tmp);
82 efl_del(file_obj);
76 83
77 fd = mkostemp(name, O_CLOEXEC); 84 fd = mkostemp(name, O_CLOEXEC);
78 if (fd < 0) goto err_fd; 85 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 *
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;
85 char *name; 87 char *name;
86 int fd = 0; 88 int fd = 0;
87 Eina_Tmpstr *fullname; 89 Eina_Tmpstr *fullname;
@@ -93,11 +95,15 @@ _shm_pool_make(struct wl_shm *shm, int size, void **data)
93 if (!shm) return NULL; 95 if (!shm) return NULL;
94 96
95 /* create tmp file name */ 97 /* create tmp file name */
96 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, 98 file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/");
97 "(:run:)/evas-wayland_shm-XXXXXX"); 99 efl_vpath_file_do(file_obj);
98 fd = eina_file_mkstemp(efl_vpath_file_result_get(file_obj), &fullname); 100 efl_vpath_file_wait(file_obj);
99 efl_del(file_obj); 101 path = efl_vpath_file_result_get(file_obj);
100 102 if ((name = malloc(strlen(path) + sizeof(tmp)))) strcpy(name, path);
103 if (!name) return NULL;
104 strcat(name, tmp);
105
106 fd = eina_file_mkstemp(name, &fullname);
101 if (fd < 0) 107 if (fd < 0)
102 /* try to create tmp file */ 108 /* try to create tmp file */
103 /* if ((fd = mkstemp(name)) < 0) */ 109 /* if ((fd = mkstemp(name)) < 0) */