summaryrefslogtreecommitdiff
path: root/src/lib/elput/elput_evdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elput/elput_evdev.c')
-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 cab7f8a..1b0ca1b 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)
64 char *path; 64 char *path;
65 char tmp[PATH_MAX]; 65 char tmp[PATH_MAX];
66 long flags; 66 long flags;
67 Eina_Tmpstr *fullname;
67 68
68 if (!(path = getenv("XDG_RUNTIME_DIR"))) 69 if (!(path = getenv("XDG_RUNTIME_DIR")))
69 return -1; 70 return -1;
70 71
71 snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path); 72 snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path);
72 73
73 fd = eina_file_mkstemp(tmp, NULL); 74 fd = eina_file_mkstemp(tmp, &fullname);
74 if (fd < 0) return -1; 75 if (fd < 0) return -1;
75 76
76 flags = fcntl(fd, F_GETFD); 77 flags = fcntl(fd, F_GETFD);
@@ -92,7 +93,8 @@ _keyboard_fd_get(off_t size)
92 return -1; 93 return -1;
93 } 94 }
94 95
95 unlink(tmp); 96 unlink(fullname);
97 eina_tmpstr_del(fullname);
96 return fd; 98 return fd;
97} 99}
98 100