ecore_wl2: Fix small bug in flush handler
authorDerek Foreman <derekf@osg.samsung.com>
Wed, 30 Aug 2017 17:16:34 +0000 (12:16 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Wed, 30 Aug 2017 19:11:47 +0000 (14:11 -0500)
If wl_display_flush() returns a non negative number it was successful,
so we should disable the write handler then.  We were theoretically always
doing an extra flush on an empty buffer.

This is mostly cosmetic as that's not a costly operation.

src/lib/ecore_wl2/ecore_wl2_display.c

index 57f98cd..69838f7 100644 (file)
@@ -514,7 +514,7 @@ _cb_connect_data(void *data, Ecore_Fd_Handler *hdl)
      {
         ret = wl_display_flush(ewd->wl.display);
         code = errno;
-        if (ret == 0)
+        if (ret >= 0)
           ecore_main_fd_handler_active_set(hdl, ECORE_FD_READ);
 
         if ((ret < 0) && (code != EAGAIN)) goto err;