ecore/main: avoid calling FD_SET with invalid fd value

Summary:
it's possible that _ecore_get_epoll_fd() can return -1, so ensure that we
correctly handle this

CID 1383850

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10394
devs/lauromoura/property_revamp
Mike Blumenkrantz 4 years ago
parent 39f384bba1
commit 36c5f1026f
  1. 3
      src/lib/ecore/ecore_main.c

@ -1825,7 +1825,8 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double timeout)
{
// polling on the epoll fd will wake when fd in the epoll set is active
max_fd = _ecore_get_epoll_fd(obj, pd);
FD_SET(max_fd, &rfds);
if (max_fd > -1)
FD_SET(max_fd, &rfds);
}
#endif
EINA_LIST_FOREACH(pd->file_fd_handlers, l, fdh)

Loading…
Cancel
Save