ecore-wl2: Fix error handling for bad fd
authorChris Michael <cpmichael@osg.samsung.com>
Sun, 3 Jul 2016 22:23:45 +0000 (18:23 -0400)
committerChris Michael <cpmichael@osg.samsung.com>
Sun, 3 Jul 2016 22:23:45 +0000 (18:23 -0400)
If we end up failing to get the fd from ecore_main_fd_handler_fd_get,
then we should just bail out of this function and try again later.

Fixes Coverity CID1357213

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
src/lib/ecore_wl2/ecore_wl2_dnd.c

index 0beac7a..e0863da 100644 (file)
@@ -232,6 +232,8 @@ _selection_data_read(void *data, Ecore_Fd_Handler *fdh)
    fd = ecore_main_fd_handler_fd_get(fdh);
    if (fd >= 0)
      len = read(fd, buffer, sizeof buffer);
+   else
+     return ECORE_CALLBACK_RENEW;
 
    event = calloc(1, sizeof(Ecore_Wl2_Event_Selection_Data_Ready));
    if (!event) return ECORE_CALLBACK_CANCEL;