devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=411089d5e3082ce22f0bb2ee133b42bddf1d2b0a

commit 411089d5e3082ce22f0bb2ee133b42bddf1d2b0a
Author: Boram Park <boram1288.p...@samsung.com>
Date:   Wed Sep 23 09:23:21 2015 -0400

    ecore_buffer: abort if wl_display_dispatch returns negative value
    
    Summary:
    If the connection between server and client has problems, 
wl_display_dispatch
    an return negative value. i.e. when enlightenment has been killed 
accidently.
    In this case, app can enter into infinite loop.
    
    Signed-off-by: Boram Park <boram1288.p...@samsung.com>
    
    Reviewers: stefan_schmidt, zmike, gwanglim, raster, devilhorns
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D3078
---
 src/lib/ecore_buffer/ecore_buffer_con.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_buffer/ecore_buffer_con.c 
b/src/lib/ecore_buffer/ecore_buffer_con.c
index 7cc4bc5..09a887a 100644
--- a/src/lib/ecore_buffer/ecore_buffer_con.c
+++ b/src/lib/ecore_buffer/ecore_buffer_con.c
@@ -248,6 +248,17 @@ _ecore_buffer_con_consumer_create(const char *name, int 
queue_size, int w, int h
 void
 _ecore_buffer_con_init_wait(void)
 {
+   int ret;
+
    while (!_connection->init_done)
-     wl_display_dispatch(_connection->display);
+     {
+        ret = wl_display_dispatch(_connection->display);
+        if ((ret < 0) && ((errno != EAGAIN) && (errno != EINVAL)))
+          {
+             /* raise exit signal */
+             ERR("Wayland socket error: %s", strerror(errno));
+             abort();
+             break;
+          }
+     }
 }

-- 


Reply via email to