summaryrefslogtreecommitdiff
path: root/src/modules/ecore_buffer
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-09 22:06:16 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-09 22:06:16 +0900
commit2037474dc0fd2b360452f2a15abcbe533b57ca37 (patch)
tree7e5da455c6dadabd9c2c023bd3b2d12abe321f67 /src/modules/ecore_buffer
parent810b17e7a4338d9fe8b6a3bebf92761880600eff (diff)
vpath usage - simplify to bare minimum to make gustavo happy
since these are only local path resolves, the do and wait are technically not needed. also remove any other tmp strings and use the vpath string resolving feature to avoid printfs/strjoins/cats etc. etc. as well.
Diffstat (limited to 'src/modules/ecore_buffer')
-rw-r--r--src/modules/ecore_buffer/shm/ecore_buffer_shm.c15
1 files changed, 4 insertions, 11 deletions
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;