efl_wl: check mkstemp return

CID 1377533
This commit is contained in:
Mike Blumenkrantz 2017-07-12 12:00:52 -04:00
parent 98e14ef3d4
commit 8c2afaf251
1 changed files with 8 additions and 0 deletions

View File

@ -3466,6 +3466,14 @@ seat_keymap_update(Comp_Seat *s)
str = xkb_map_get_as_string(s->kbd.keymap);
s->kbd.keymap_mem_size = strlen(str) + 1;
s->kbd.keymap_fd = eina_file_mkstemp("comp-keymapXXXXXX", &file);
if (s->kbd.keymap_fd < 0)
{
EINA_LOG_ERR("mkstemp failed!\n");
s->kbd.keymap_fd = -1;
xkb_state_unref(s->kbd.state);
s->kbd.state = NULL;
return;
}
if (!eina_file_close_on_exec(s->kbd.keymap_fd, 1))
{
EINA_LOG_ERR("Failed to set CLOEXEC on fd %d\n", s->kbd.keymap_fd);