diff options
author | Jiergir Ogoerg <f35f22fan@gmail.com> | 2013-07-29 16:50:44 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-07-29 16:50:44 -0700 |
commit | c1fd097cd995ec02cfcf673fa243f95d4439bac2 (patch) | |
tree | e2c045c37f8b05815c9929f6c7bfc4011132977f /src | |
parent | 03dc786c906d9567bd09cbf4ad17263edc381cc8 (diff) |
client: Simply wl_display_dispatch_queue_pending() and fix return value
We're supposed to return number of events dispatched on success, not 0.
Refactor to avoid goto and just return ret.
Diffstat (limited to 'src')
-rw-r--r-- | src/wayland-client.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c index 2887a40..532d379 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -1157,18 +1157,15 @@ WL_EXPORT int wl_display_dispatch_queue_pending(struct wl_display *display, struct wl_event_queue *queue) { + int ret; + pthread_mutex_lock(&display->mutex); - if (dispatch_queue(display, queue) == -1) - goto err_unlock; + ret = dispatch_queue(display, queue); pthread_mutex_unlock(&display->mutex); - return 0; - - err_unlock: - pthread_mutex_unlock(&display->mutex); - return -1; + return ret; } /** Process incoming events |