From 6e91caf73f8d50ba16327bafbb879a088aa49d34 Mon Sep 17 00:00:00 2001 From: Ulisses Furquim Date: Wed, 9 Jan 2013 12:22:52 +0000 Subject: [PATCH] evas/async_events: more clear code in _async_events_put() SVN revision: 82457 --- src/lib/evas/canvas/evas_async_events.c | 35 ++++++++++++++----------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/lib/evas/canvas/evas_async_events.c b/src/lib/evas/canvas/evas_async_events.c index 6d9fac74ee..f42478702b 100644 --- a/src/lib/evas/canvas/evas_async_events.c +++ b/src/lib/evas/canvas/evas_async_events.c @@ -216,8 +216,8 @@ EAPI Eina_Bool evas_async_events_put(const void *target, Evas_Callback_Type type, void *event_info, Evas_Async_Events_Put_Cb func) { Evas_Event_Async *ev; - ssize_t check; - int count; + unsigned int count; + Eina_Bool ret; if (!func) return EINA_FALSE; if (_fd_write == -1) return EINA_FALSE; @@ -244,6 +244,7 @@ evas_async_events_put(const void *target, Evas_Callback_Type type, void *event_i if (count == 0) { int wakeup = 1; + ssize_t check; do { @@ -251,21 +252,25 @@ evas_async_events_put(const void *target, Evas_Callback_Type type, void *event_i } while ((check != sizeof (int)) && ((errno == EINTR) || (errno == EAGAIN))); + + if (check == sizeof (int)) ret = EINA_TRUE; + else + { + ret = EINA_FALSE; + + switch (errno) + { + case EBADF: + case EINVAL: + case EIO: + case EPIPE: + _fd_write = -1; + } + } } + else ret = EINA_TRUE; evas_cache_image_wakeup(); - if ((count != 0) || (check == sizeof (int))) - return EINA_TRUE; - - switch (errno) - { - case EBADF: - case EINVAL: - case EIO: - case EPIPE: - _fd_write = -1; - } - - return EINA_FALSE; + return ret; } -- 2.34.1