summaryrefslogtreecommitdiff
path: root/src/lib/efl_wl/efl_wl.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-07-12 12:00:52 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-07-12 11:59:20 -0400
commit98e14ef3d496c2665395f8d8cf84b35a47739154 (patch)
tree9dee061360b3a26f046b09426f1527065fbecc1d /src/lib/efl_wl/efl_wl.c
parent627fc6842adc64da7ee0d4ac25f5bb1ea1aab1ea (diff)
efl_wl: error and cleanup on CLOEXEC fail
CID 1377530, 1377531
Diffstat (limited to 'src/lib/efl_wl/efl_wl.c')
-rw-r--r--src/lib/efl_wl/efl_wl.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c
index d1760a39e5..6f9dd313d2 100644
--- a/src/lib/efl_wl/efl_wl.c
+++ b/src/lib/efl_wl/efl_wl.c
@@ -3466,10 +3466,15 @@ seat_keymap_update(Comp_Seat *s)
3466 str = xkb_map_get_as_string(s->kbd.keymap); 3466 str = xkb_map_get_as_string(s->kbd.keymap);
3467 s->kbd.keymap_mem_size = strlen(str) + 1; 3467 s->kbd.keymap_mem_size = strlen(str) + 1;
3468 s->kbd.keymap_fd = eina_file_mkstemp("comp-keymapXXXXXX", &file); 3468 s->kbd.keymap_fd = eina_file_mkstemp("comp-keymapXXXXXX", &file);
3469 { 3469 if (!eina_file_close_on_exec(s->kbd.keymap_fd, 1))
3470 int flags = fcntl(s->kbd.keymap_fd, F_GETFD); 3470 {
3471 fcntl(s->kbd.keymap_fd, F_SETFD, flags | FD_CLOEXEC); 3471 EINA_LOG_ERR("Failed to set CLOEXEC on fd %d\n", s->kbd.keymap_fd);
3472 } 3472 close(s->kbd.keymap_fd);
3473 s->kbd.keymap_fd = -1;
3474 xkb_state_unref(s->kbd.state);
3475 s->kbd.state = NULL;
3476 return;
3477 }
3473 ftruncate(s->kbd.keymap_fd, s->kbd.keymap_mem_size); 3478 ftruncate(s->kbd.keymap_fd, s->kbd.keymap_mem_size);
3474 eina_file_unlink(file); 3479 eina_file_unlink(file);
3475 eina_tmpstr_del(file); 3480 eina_tmpstr_del(file);