summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-07-26 12:22:36 -0500
committerDerek Foreman <derekf@osg.samsung.com>2016-07-26 12:38:24 -0500
commit8b87cd9e465fbae14d47c145c588d500d6401f68 (patch)
treed35572b27152161e6354cc8e4923c75582953f9f
parented55b1f733599f82d3b820d926546e0586731184 (diff)
wayland_shm: Use correct filename in unlink
We switched from mkstemp to eina_file_mkstemp() but ended up unlinking the template filename, which didn't exist on the filesystem.
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 92aae08..492f6be 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -86,6 +86,7 @@ _shm_pool_make(struct wl_shm *shm, int size, void **data)
86 const char *path; 86 const char *path;
87 char *name; 87 char *name;
88 int fd = 0; 88 int fd = 0;
89 Eina_Tmpstr *fullname;
89 90
90 LOGFN(__FILE__, __LINE__, __FUNCTION__); 91 LOGFN(__FILE__, __LINE__, __FUNCTION__);
91 92
@@ -108,7 +109,7 @@ _shm_pool_make(struct wl_shm *shm, int size, void **data)
108 109
109 strcat(name, tmp); 110 strcat(name, tmp);
110 111
111 fd = eina_file_mkstemp(name, NULL); 112 fd = eina_file_mkstemp(name, &fullname);
112 if (fd < 0) 113 if (fd < 0)
113 /* try to create tmp file */ 114 /* try to create tmp file */
114 /* if ((fd = mkstemp(name)) < 0) */ 115 /* if ((fd = mkstemp(name)) < 0) */
@@ -118,8 +119,9 @@ _shm_pool_make(struct wl_shm *shm, int size, void **data)
118 return NULL; 119 return NULL;
119 } 120 }
120 121
121 unlink(name); 122 unlink(fullname);
122 free(name); 123 free(name);
124 eina_tmpstr_del(fullname);
123 125
124 /* try to truncate file to size */ 126 /* try to truncate file to size */
125 if (ftruncate(fd, size) < 0) 127 if (ftruncate(fd, size) < 0)