aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wayland
diff options
context:
space:
mode:
authorBoram Park <boram1288.park@samsung.com>2015-09-23 09:22:29 -0400
committerChris Michael <cp.michael@samsung.com>2015-09-23 09:22:29 -0400
commit3ebdfd8779d53c032649f52a69f0bc5b77999861 (patch)
tree0e6ba7c162a39b099745aec4264506223a084e03 /src/lib/ecore_wayland
parentecore_evas_extn: remove old buffer in evas render post function. (diff)
downloadefl-3ebdfd8779d53c032649f52a69f0bc5b77999861.tar.gz
ecore_wl: 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.park@samsung.com> Reviewers: stefan_schmidt, zmike, gwanglim, raster, devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3077
Diffstat (limited to 'src/lib/ecore_wayland')
-rw-r--r--src/lib/ecore_wayland/ecore_wl.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index 13758c6c3f..b9ad8543dd 100644
--- a/src/lib/ecore_wayland/ecore_wl.c
+++ b/src/lib/ecore_wayland/ecore_wl.c
@@ -121,8 +121,18 @@ _ecore_wl_init_callback(void *data, struct wl_callback *callback, uint32_t seria
static void
_ecore_wl_init_wait(void)
{
+ int ret;
while (!_ecore_wl_disp->init_done)
- wl_display_dispatch(_ecore_wl_disp->wl.display);
+ {
+ ret = wl_display_dispatch(_ecore_wl_disp->wl.display);
+ if ((ret < 0) && ((errno != EAGAIN) && (errno != EINVAL)))
+ {
+ /* raise exit signal */
+ ERR("Wayland socket error: %s", strerror(errno));
+ abort();
+ break;
+ }
+ }
}
EAPI int
@@ -262,10 +272,20 @@ ecore_wl_flush(void)
EAPI void
ecore_wl_sync(void)
{
+ int ret;
if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) return;
_ecore_wl_sync_wait(_ecore_wl_disp);
while (_ecore_wl_disp->sync_ref_count > 0)
- wl_display_dispatch(_ecore_wl_disp->wl.display);
+ {
+ ret = wl_display_dispatch(_ecore_wl_disp->wl.display);
+ if ((ret < 0) && ((errno != EAGAIN) && (errno != EINVAL)))
+ {
+ /* raise exit signal */
+ ERR("Wayland socket error: %s", strerror(errno));
+ abort();
+ break;
+ }
+ }
}
EAPI struct wl_shm *
@@ -407,9 +427,18 @@ ecore_wl_dpi_get(void)
EAPI void
ecore_wl_display_iterate(void)
{
+ int ret;
if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) return;
if (!_ecore_wl_server_mode)
- wl_display_dispatch(_ecore_wl_disp->wl.display);
+ {
+ ret = wl_display_dispatch(_ecore_wl_disp->wl.display);
+ if ((ret < 0) && ((errno != EAGAIN) && (errno != EINVAL)))
+ {
+ /* raise exit signal */
+ ERR("Wayland socket error: %s", strerror(errno));
+ abort();
+ }
+ }
}
/* @since 1.8 */