diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2016-07-26 12:22:36 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2016-07-26 12:22:36 -0500 |
commit | d0bd58e45c4d9bb2324b3c7ae21bbb48766811cc (patch) | |
tree | b19f751ccab7c2105bfdcdbf80784498d0845a09 | |
parent | 5d9cb399112b3c7ded0c644f27de03a0a00d7d81 (diff) | |
download | efl-d0bd58e45c4d9bb2324b3c7ae21bbb48766811cc.tar.gz |
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.c | 6 |
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 92aae08444..492f6be509 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) const char *path; char *name; int fd = 0; + Eina_Tmpstr *fullname; LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -108,7 +109,7 @@ _shm_pool_make(struct wl_shm *shm, int size, void **data) strcat(name, tmp); - fd = eina_file_mkstemp(name, NULL); + fd = eina_file_mkstemp(name, &fullname); if (fd < 0) /* try to create tmp file */ /* if ((fd = mkstemp(name)) < 0) */ @@ -118,8 +119,9 @@ _shm_pool_make(struct wl_shm *shm, int size, void **data) return NULL; } - unlink(name); + unlink(fullname); free(name); + eina_tmpstr_del(fullname); /* try to truncate file to size */ if (ftruncate(fd, size) < 0) |