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.park@samsung.com>

Reviewers: stefan_schmidt, zmike, gwanglim, raster, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3078
This commit is contained in:
Boram Park 2015-09-23 09:23:21 -04:00 committed by Chris Michael
parent 3ebdfd8779
commit 411089d5e3
1 changed files with 12 additions and 1 deletions

View File

@ -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;
}
}
}