discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7c80d82f25fbf3b56f131038483baeb6844fa646

commit 7c80d82f25fbf3b56f131038483baeb6844fa646
Author: Mike Blumenkrantz <[email protected]>
Date:   Wed Jul 12 12:00:52 2017 -0400

    efl-wl: check returns in x11 selection request handler
    
    CID 1377518
---
 src/lib/efl_wl/x11.x | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/lib/efl_wl/x11.x b/src/lib/efl_wl/x11.x
index 892b167d35..f33bdcedc6 100644
--- a/src/lib/efl_wl/x11.x
+++ b/src/lib/efl_wl/x11.x
@@ -342,9 +342,19 @@ x11_selection_request(void *d EINA_UNUSED, int t 
EINA_UNUSED, Ecore_X_Event_Sele
             {
                int fds[2];
 
+               if (socketpair(AF_UNIX, (SOCK_STREAM | SOCK_CLOEXEC), 0, fds) < 
0)
+                 {
+                    EINA_LOG_ERR("socketpair failed!\n");
+                    continue;
+                 }
+               if (fcntl(fds[0], F_SETFL, O_NONBLOCK) < 0)
+                 {
+                    close(fds[0]);
+                    close(fds[1]);
+                    EINA_LOG_ERR("NONBLOCK for socketpair failed!\n");
+                    continue;
+                 }
                p = calloc(1, sizeof(Pipe));
-               socketpair(AF_UNIX, (SOCK_STREAM | SOCK_CLOEXEC), 0, fds);
-               fcntl(fds[0], F_SETFL, O_NONBLOCK);
                p->fdh = ecore_main_fd_handler_add(fds[0], ECORE_FD_READ, 
x11_pipe_read, p, NULL, NULL);
                p->win = ev->requestor;
                p->source = source;

-- 


Reply via email to