ecore-wl2: Fix error handling for bad fd

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>
This commit is contained in:
Chris Michael 2016-07-03 18:23:45 -04:00
parent 5c8ea3a6f3
commit 7496df08aa
1 changed files with 2 additions and 0 deletions

View 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;