aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-07-26 12:34:27 -0500
committerDerek Foreman <derekf@osg.samsung.com>2016-07-26 12:38:24 -0500
commit3d5dbbfcd02fcef8c902573496ad1b668425f386 (patch)
tree5e63c5a66437cba95247e6954e622ef4e876d9c8
parentwayland_shm: Use correct filename in unlink (diff)
downloadefl-3d5dbbfcd02fcef8c902573496ad1b668425f386.tar.gz
elput: 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/lib/elput/elput_evdev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index cab7f8a5a6..1b0ca1b183 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -64,13 +64,14 @@ _keyboard_fd_get(off_t size)
char *path;
char tmp[PATH_MAX];
long flags;
+ Eina_Tmpstr *fullname;
if (!(path = getenv("XDG_RUNTIME_DIR")))
return -1;
snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path);
- fd = eina_file_mkstemp(tmp, NULL);
+ fd = eina_file_mkstemp(tmp, &fullname);
if (fd < 0) return -1;
flags = fcntl(fd, F_GETFD);
@@ -92,7 +93,8 @@ _keyboard_fd_get(off_t size)
return -1;
}
- unlink(tmp);
+ unlink(fullname);
+ eina_tmpstr_del(fullname);
return fd;
}