summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_main.c
diff options
context:
space:
mode:
authorMike McCormack <mj.mccormack@samsung.com>2011-07-06 10:54:30 +0000
committerMike McCormack <mikem@ring3k.org>2011-07-06 10:54:30 +0000
commitc94a9eff7fc6318c43ef2914de297130f2bceb02 (patch)
treed7bed76a1d0986279c434ff24cfae40a05b49241 /legacy/ecore/src/lib/ecore/ecore_main.c
parent829571df274090d9c72bb13ba6d1da04429c4f99 (diff)
ecore: Remove most #ifdef HAVE_EPOLL blocks
Replace with if statements and stub epoll calls, and let the compiler optimize out the stub code. Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> SVN revision: 61081
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_main.c316
1 files changed, 172 insertions, 144 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_main.c b/legacy/ecore/src/lib/ecore/ecore_main.c
index 1f3216f902..fe9cf8c625 100644
--- a/legacy/ecore/src/lib/ecore/ecore_main.c
+++ b/legacy/ecore/src/lib/ecore/ecore_main.c
@@ -59,8 +59,49 @@
59#include "ecore_private.h" 59#include "ecore_private.h"
60 60
61#ifdef HAVE_SYS_EPOLL_H 61#ifdef HAVE_SYS_EPOLL_H
62# define HAVE_EPOLL 62# define HAVE_EPOLL 1
63# include <sys/epoll.h> 63# include <sys/epoll.h>
64#else
65
66# define HAVE_EPOLL 0
67# define EPOLLIN 1
68# define EPOLLOUT 2
69# define EPOLLERR 8
70
71#define EPOLL_CTL_ADD 1
72#define EPOLL_CTL_DEL 2
73#define EPOLL_CTL_MOD 3
74
75typedef union epoll_data {
76 void *ptr;
77 int fd;
78 uint32_t u32;
79 uint64_t u64;
80} epoll_data_t;
81
82struct epoll_event {
83 uint32_t events;
84 epoll_data_t data;
85};
86
87static inline int
88epoll_create(int size)
89{
90 return -1;
91}
92
93static inline int
94epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
95{
96 return -1;
97}
98
99static inline int
100epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
101{
102 return -1;
103}
104
64#endif 105#endif
65 106
66#ifdef HAVE_SYS_TIMERFD_H 107#ifdef HAVE_SYS_TIMERFD_H
@@ -111,7 +152,7 @@ struct _Ecore_Fd_Handler
111 Eina_Bool write_active : 1; 152 Eina_Bool write_active : 1;
112 Eina_Bool error_active : 1; 153 Eina_Bool error_active : 1;
113 Eina_Bool delete_me : 1; 154 Eina_Bool delete_me : 1;
114#if defined(USE_G_MAIN_LOOP) && !defined(HAVE_EPOLL) 155#if defined(USE_G_MAIN_LOOP)
115 GPollFD gfd; 156 GPollFD gfd;
116#endif 157#endif
117}; 158};
@@ -184,15 +225,11 @@ static double t2 = 0.0;
184#endif 225#endif
185 226
186static int timer_fd = -1; 227static int timer_fd = -1;
187#ifdef HAVE_EPOLL
188static int epoll_fd = -1; 228static int epoll_fd = -1;
189static pid_t epoll_pid; 229static pid_t epoll_pid;
190#endif
191 230
192#ifdef USE_G_MAIN_LOOP 231#ifdef USE_G_MAIN_LOOP
193#ifdef HAVE_EPOLL
194static GPollFD ecore_epoll_fd; 232static GPollFD ecore_epoll_fd;
195#endif
196static GPollFD ecore_timer_fd; 233static GPollFD ecore_timer_fd;
197static GSource *ecore_glib_source; 234static GSource *ecore_glib_source;
198static guint ecore_glib_source_id; 235static guint ecore_glib_source_id;
@@ -201,16 +238,17 @@ static gboolean ecore_idling;
201static gboolean ecore_fds_ready; 238static gboolean ecore_fds_ready;
202#endif 239#endif
203 240
204void 241static inline void
205_ecore_fd_valid(void) 242_ecore_fd_valid(void)
206{ 243{
207#ifdef HAVE_EPOLL 244 if (HAVE_EPOLL && epoll_fd >= 0)
208 if (fcntl(epoll_fd, F_GETFD) < 0)
209 { 245 {
210 ERR("arghhh you caught me! report a backtrace to edevel!"); 246 if (fcntl(epoll_fd, F_GETFD) < 0)
211 pause(); 247 {
248 ERR("arghhh you caught me! report a backtrace to edevel!");
249 pause();
250 }
212 } 251 }
213#endif
214} 252}
215 253
216static inline void 254static inline void
@@ -231,7 +269,6 @@ _ecore_try_add_to_call_list(Ecore_Fd_Handler *fdh)
231 } 269 }
232} 270}
233 271
234#ifdef HAVE_EPOLL
235static inline int 272static inline int
236_ecore_get_epoll_fd(void) 273_ecore_get_epoll_fd(void)
237{ 274{
@@ -268,13 +305,6 @@ _ecore_poll_events_from_fdh(Ecore_Fd_Handler *fdh)
268 if (fdh->flags & ECORE_FD_ERROR) events |= EPOLLERR; 305 if (fdh->flags & ECORE_FD_ERROR) events |= EPOLLERR;
269 return events; 306 return events;
270} 307}
271#else
272static inline int
273_ecore_poll_events_from_fdh(Ecore_Fd_Handler *fdh __UNUSED__)
274{
275 return 0;
276}
277#endif
278 308
279#ifdef USE_G_MAIN_LOOP 309#ifdef USE_G_MAIN_LOOP
280static inline int 310static inline int
@@ -292,94 +322,91 @@ static inline int
292_ecore_main_fdh_poll_add(Ecore_Fd_Handler *fdh) 322_ecore_main_fdh_poll_add(Ecore_Fd_Handler *fdh)
293{ 323{
294 int r = 0; 324 int r = 0;
295#ifdef HAVE_EPOLL 325
296 r = _ecore_epoll_add(_ecore_get_epoll_fd(), fdh->fd, 326 if (HAVE_EPOLL && epoll_fd >= 0)
297 _ecore_poll_events_from_fdh(fdh), fdh);
298#elif USE_G_MAIN_LOOP
299 fdh->gfd.fd = fdh->fd;
300 fdh->gfd.events = _gfd_events_from_fdh(fdh);
301 fdh->gfd.revents = 0;
302 INF("adding gpoll on %d %08x", fdh->fd, fdh->gfd.events);
303 g_source_add_poll(ecore_glib_source, &fdh->gfd);
304#else
305 if (!ECORE_MAGIC_CHECK(fdh, ECORE_MAGIC_FD_HANDLER))
306 { 327 {
307 ECORE_MAGIC_FAIL(fdh, ECORE_MAGIC_FD_HANDLER, 328 r = _ecore_epoll_add(_ecore_get_epoll_fd(), fdh->fd,
308 "_ecore_main_fdh_poll_add"); 329 _ecore_poll_events_from_fdh(fdh), fdh);
309 } 330 }
331 else
332 {
333#ifdef USE_G_MAIN_LOOP
334 fdh->gfd.fd = fdh->fd;
335 fdh->gfd.events = _gfd_events_from_fdh(fdh);
336 fdh->gfd.revents = 0;
337 INF("adding gpoll on %d %08x", fdh->fd, fdh->gfd.events);
338 g_source_add_poll(ecore_glib_source, &fdh->gfd);
310#endif 339#endif
340 }
311 return r; 341 return r;
312} 342}
313 343
314static inline void 344static inline void
315_ecore_main_fdh_poll_del(Ecore_Fd_Handler *fdh) 345_ecore_main_fdh_poll_del(Ecore_Fd_Handler *fdh)
316{ 346{
317#ifdef HAVE_EPOLL 347 if (HAVE_EPOLL && epoll_fd >= 0)
318 struct epoll_event ev;
319 int efd = _ecore_get_epoll_fd();
320
321 memset(&ev, 0, sizeof (ev));
322 INF("removing poll on %d", fdh->fd);
323 /* could get an EBADF if somebody closed the FD before removing it */
324 if ((epoll_ctl(efd, EPOLL_CTL_DEL, fdh->fd, &ev) < 0))
325 { 348 {
326 if (errno == EBADF) 349 struct epoll_event ev;
327 { 350 int efd = _ecore_get_epoll_fd();
328 WRN("fd %d was closed, can't remove from epoll - reinit!", 351
329 fdh->fd); 352 memset(&ev, 0, sizeof (ev));
330 _ecore_main_loop_shutdown(); 353 INF("removing poll on %d", fdh->fd);
331 _ecore_main_loop_init(); 354 /* could get an EBADF if somebody closed the FD before removing it */
332 } 355 if ((epoll_ctl(efd, EPOLL_CTL_DEL, fdh->fd, &ev) < 0))
333 else
334 { 356 {
335 ERR("Failed to delete epoll fd %d! (errno=%d)", fdh->fd, errno); 357 if (errno == EBADF)
358 {
359 WRN("fd %d was closed, can't remove from epoll - reinit!",
360 fdh->fd);
361 _ecore_main_loop_shutdown();
362 _ecore_main_loop_init();
363 }
364 else
365 {
366 ERR("Failed to delete epoll fd %d! (errno=%d)", fdh->fd, errno);
367 }
336 } 368 }
337 } 369 }
338#elif USE_G_MAIN_LOOP 370 else
339 fdh->gfd.fd = fdh->fd;
340 fdh->gfd.events = _gfd_events_from_fdh(fdh);
341 fdh->gfd.revents = 0;
342 INF("adding gpoll on %d %08x", fdh->fd, fdh->gfd.events);
343 g_source_add_poll(ecore_glib_source, &fdh->gfd);
344#else
345 if (!ECORE_MAGIC_CHECK(fdh, ECORE_MAGIC_FD_HANDLER))
346 { 371 {
347 ECORE_MAGIC_FAIL(fdh, ECORE_MAGIC_FD_HANDLER, 372#ifdef USE_G_MAIN_LOOP
348 "_ecore_main_fdh_poll_del"); 373 fdh->gfd.fd = fdh->fd;
349 } 374 fdh->gfd.events = _gfd_events_from_fdh(fdh);
375 fdh->gfd.revents = 0;
376 INF("adding gpoll on %d %08x", fdh->fd, fdh->gfd.events);
377 g_source_add_poll(ecore_glib_source, &fdh->gfd);
350#endif 378#endif
379 }
351} 380}
352 381
353static inline int 382static inline int
354_ecore_main_fdh_poll_modify(Ecore_Fd_Handler *fdh) 383_ecore_main_fdh_poll_modify(Ecore_Fd_Handler *fdh)
355{ 384{
356 int r = 0; 385 int r = 0;
357#ifdef HAVE_EPOLL 386 if (HAVE_EPOLL && epoll_fd >= 0)
358 struct epoll_event ev;
359 int efd = _ecore_get_epoll_fd();
360
361 memset(&ev, 0, sizeof (ev));
362 ev.events = _ecore_poll_events_from_fdh(fdh);
363 ev.data.ptr = fdh;
364 INF("modifing epoll on %d to %08x", fdh->fd, ev.events);
365 r = epoll_ctl(efd, EPOLL_CTL_MOD, fdh->fd, &ev);
366#elif USE_G_MAIN_LOOP
367 fdh->gfd.fd = fdh->fd;
368 fdh->gfd.events = _gfd_events_from_fdh(fdh);
369 fdh->gfd.revents = 0;
370 INF("modifing gpoll on %d to %08x", fdh->fd, fdh->gfd.events);
371#else
372 if (!ECORE_MAGIC_CHECK(fdh, ECORE_MAGIC_FD_HANDLER))
373 { 387 {
374 ECORE_MAGIC_FAIL(fdh, ECORE_MAGIC_FD_HANDLER, 388 struct epoll_event ev;
375 "_ecore_main_fdh_poll_modify"); 389 int efd = _ecore_get_epoll_fd();
390
391 memset(&ev, 0, sizeof (ev));
392 ev.events = _ecore_poll_events_from_fdh(fdh);
393 ev.data.ptr = fdh;
394 INF("modifing epoll on %d to %08x", fdh->fd, ev.events);
395 r = epoll_ctl(efd, EPOLL_CTL_MOD, fdh->fd, &ev);
376 } 396 }
397 else
398 {
399#ifdef USE_G_MAIN_LOOP
400 fdh->gfd.fd = fdh->fd;
401 fdh->gfd.events = _gfd_events_from_fdh(fdh);
402 fdh->gfd.revents = 0;
403 INF("modifing gpoll on %d to %08x", fdh->fd, fdh->gfd.events);
377#endif 404#endif
405 }
378 return r; 406 return r;
379} 407}
380 408
381#ifdef HAVE_EPOLL 409static inline int _ecore_main_fdh_epoll_mark_active(void)
382static inline int _ecore_main_fdh_poll_mark_active(void)
383{ 410{
384 struct epoll_event ev[32]; 411 struct epoll_event ev[32];
385 int i, ret; 412 int i, ret;
@@ -402,7 +429,7 @@ static inline int _ecore_main_fdh_poll_mark_active(void)
402 if (!ECORE_MAGIC_CHECK(fdh, ECORE_MAGIC_FD_HANDLER)) 429 if (!ECORE_MAGIC_CHECK(fdh, ECORE_MAGIC_FD_HANDLER))
403 { 430 {
404 ECORE_MAGIC_FAIL(fdh, ECORE_MAGIC_FD_HANDLER, 431 ECORE_MAGIC_FAIL(fdh, ECORE_MAGIC_FD_HANDLER,
405 "_ecore_main_fdh_poll_mark_active"); 432 "_ecore_main_fdh_epoll_mark_active");
406 continue; 433 continue;
407 } 434 }
408 if (fdh->delete_me) 435 if (fdh->delete_me)
@@ -424,9 +451,9 @@ static inline int _ecore_main_fdh_poll_mark_active(void)
424 return ret; 451 return ret;
425} 452}
426 453
427#elif USE_G_MAIN_LOOP 454#ifdef USE_G_MAIN_LOOP
428 455
429static inline int _ecore_main_fdh_poll_mark_active(void) 456static inline int _ecore_main_fdh_glib_mark_active(void)
430{ 457{
431 Ecore_Fd_Handler *fdh; 458 Ecore_Fd_Handler *fdh;
432 int ret = 0; 459 int ret = 0;
@@ -454,10 +481,6 @@ static inline int _ecore_main_fdh_poll_mark_active(void)
454 return ret; 481 return ret;
455} 482}
456 483
457#endif
458
459#ifdef USE_G_MAIN_LOOP
460
461/* like we are about to enter main_loop_select in _ecore_main_select */ 484/* like we are about to enter main_loop_select in _ecore_main_select */
462static gboolean 485static gboolean
463_ecore_main_gsource_prepare(GSource *source __UNUSED__, gint *next_time) 486_ecore_main_gsource_prepare(GSource *source __UNUSED__, gint *next_time)
@@ -571,7 +594,10 @@ _ecore_main_gsource_check(GSource *source __UNUSED__)
571 ret = TRUE; 594 ret = TRUE;
572 595
573 /* check if fds are ready */ 596 /* check if fds are ready */
574 ecore_fds_ready = (_ecore_main_fdh_poll_mark_active() > 0); 597 if (HAVE_EPOLL && epoll_fd >= 0)
598 ecore_fds_ready = (_ecore_main_fdh_epoll_mark_active() > 0);
599 else
600 ecore_fds_ready = (_ecore_main_fdh_glib_mark_active() > 0);
575 _ecore_main_fd_handlers_cleanup(); 601 _ecore_main_fd_handlers_cleanup();
576 602
577 /* check timers after updating loop time */ 603 /* check timers after updating loop time */
@@ -581,6 +607,7 @@ _ecore_main_gsource_check(GSource *source __UNUSED__)
581 double next_time = _ecore_timer_next_get(); 607 double next_time = _ecore_timer_next_get();
582 ret = _ecore_timers_exists() && (0.0 >= next_time); 608 ret = _ecore_timers_exists() && (0.0 >= next_time);
583 } 609 }
610
584 _ecore_timer_enable_new(); 611 _ecore_timer_enable_new();
585 612
586 in_main_loop--; 613 in_main_loop--;
@@ -668,10 +695,10 @@ void
668_ecore_main_loop_init(void) 695_ecore_main_loop_init(void)
669{ 696{
670 INF("enter"); 697 INF("enter");
671#ifdef HAVE_EPOLL 698
672 epoll_fd = epoll_create(1); 699 epoll_fd = epoll_create(1);
673 if (epoll_fd < 0) 700 if (epoll_fd < 0)
674 CRIT("Failed to create epoll fd!"); 701 WRN("Failed to create epoll fd!");
675 epoll_pid = getpid(); 702 epoll_pid = getpid();
676 703
677 /* add polls on all our file descriptors */ 704 /* add polls on all our file descriptors */
@@ -685,8 +712,6 @@ _ecore_main_loop_init(void)
685 _ecore_main_fdh_poll_add(fdh); 712 _ecore_main_fdh_poll_add(fdh);
686 } 713 }
687 714
688#endif
689
690 /* setup for the g_main_loop only integration */ 715 /* setup for the g_main_loop only integration */
691#ifdef USE_G_MAIN_LOOP 716#ifdef USE_G_MAIN_LOOP
692 ecore_glib_source = g_source_new(&ecore_gsource_funcs, sizeof (GSource)); 717 ecore_glib_source = g_source_new(&ecore_gsource_funcs, sizeof (GSource));
@@ -694,13 +719,14 @@ _ecore_main_loop_init(void)
694 CRIT("Failed to create glib source for epoll!"); 719 CRIT("Failed to create glib source for epoll!");
695 else 720 else
696 { 721 {
697 /* epoll multiplexes fds into the g_main_loop */ 722 if (HAVE_EPOLL && epoll_fd >= 0)
698#ifdef HAVE_EPOLL 723 {
699 ecore_epoll_fd.fd = epoll_fd; 724 /* epoll multiplexes fds into the g_main_loop */
700 ecore_epoll_fd.events = G_IO_IN; 725 ecore_epoll_fd.fd = epoll_fd;
701 ecore_epoll_fd.revents = 0; 726 ecore_epoll_fd.events = G_IO_IN;
702 g_source_add_poll(ecore_glib_source, &ecore_epoll_fd); 727 ecore_epoll_fd.revents = 0;
703#endif 728 g_source_add_poll(ecore_glib_source, &ecore_epoll_fd);
729 }
704 730
705 /* timerfd gives us better than millisecond accuracy in g_main_loop */ 731 /* timerfd gives us better than millisecond accuracy in g_main_loop */
706 timer_fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK); 732 timer_fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
@@ -732,15 +758,12 @@ _ecore_main_loop_shutdown(void)
732 } 758 }
733#endif 759#endif
734 760
735#ifdef HAVE_EPOLL
736 if (epoll_fd >= 0) 761 if (epoll_fd >= 0)
737 { 762 {
738 close(epoll_fd); 763 close(epoll_fd);
739 epoll_fd = -1; 764 epoll_fd = -1;
740 } 765 }
741
742 epoll_pid = 0; 766 epoll_pid = 0;
743#endif
744 767
745 if (timer_fd >= 0) 768 if (timer_fd >= 0)
746 { 769 {
@@ -1258,9 +1281,6 @@ _ecore_main_select(double timeout)
1258 fd_set rfds, wfds, exfds; 1281 fd_set rfds, wfds, exfds;
1259 int max_fd; 1282 int max_fd;
1260 int ret; 1283 int ret;
1261#ifndef HAVE_EPOLL
1262 Ecore_Fd_Handler *fdh;
1263#endif
1264 1284
1265 t = NULL; 1285 t = NULL;
1266 if ((!ECORE_FINITE(timeout)) || (timeout == 0.0)) /* finite() tests for NaN, too big, too small, and infinity. */ 1286 if ((!ECORE_FINITE(timeout)) || (timeout == 0.0)) /* finite() tests for NaN, too big, too small, and infinity. */
@@ -1293,38 +1313,44 @@ _ecore_main_select(double timeout)
1293 /* call the prepare callback for all handlers */ 1313 /* call the prepare callback for all handlers */
1294 if (fd_handlers_with_prep) 1314 if (fd_handlers_with_prep)
1295 _ecore_main_prepare_handlers(); 1315 _ecore_main_prepare_handlers();
1296#ifndef HAVE_EPOLL 1316
1297 EINA_INLIST_FOREACH(fd_handlers, fdh) 1317 if (!HAVE_EPOLL || epoll_fd < 0)
1298 { 1318 {
1299 if (!fdh->delete_me) 1319 Ecore_Fd_Handler *fdh;
1320
1321 EINA_INLIST_FOREACH(fd_handlers, fdh)
1300 { 1322 {
1301 if (fdh->flags & ECORE_FD_READ) 1323 if (!fdh->delete_me)
1302 {
1303 FD_SET(fdh->fd, &rfds);
1304 if (fdh->fd > max_fd) max_fd = fdh->fd;
1305 }
1306 if (fdh->flags & ECORE_FD_WRITE)
1307 {
1308 FD_SET(fdh->fd, &wfds);
1309 if (fdh->fd > max_fd) max_fd = fdh->fd;
1310 }
1311 if (fdh->flags & ECORE_FD_ERROR)
1312 { 1324 {
1313 FD_SET(fdh->fd, &exfds); 1325 if (fdh->flags & ECORE_FD_READ)
1314 if (fdh->fd > max_fd) max_fd = fdh->fd; 1326 {
1327 FD_SET(fdh->fd, &rfds);
1328 if (fdh->fd > max_fd) max_fd = fdh->fd;
1329 }
1330 if (fdh->flags & ECORE_FD_WRITE)
1331 {
1332 FD_SET(fdh->fd, &wfds);
1333 if (fdh->fd > max_fd) max_fd = fdh->fd;
1334 }
1335 if (fdh->flags & ECORE_FD_ERROR)
1336 {
1337 FD_SET(fdh->fd, &exfds);
1338 if (fdh->fd > max_fd) max_fd = fdh->fd;
1339 }
1315 } 1340 }
1316 } 1341 }
1342 }
1343 else
1344 {
1345 /* polling on the epoll fd will wake when an fd in the epoll set is active */
1346 max_fd = _ecore_get_epoll_fd();
1347 FD_SET(max_fd, &rfds);
1317 } 1348 }
1318#else /* HAVE_EPOLL */
1319 /* polling on the epoll fd will wake when an fd in the epoll set is active */
1320 max_fd = _ecore_get_epoll_fd();
1321 FD_SET(max_fd, &rfds);
1322#endif /* HAVE_EPOLL */
1323 1349
1324 if (_ecore_signal_count_get()) return -1; 1350 if (_ecore_signal_count_get()) return -1;
1325 1351
1326 ret = main_loop_select(max_fd + 1, &rfds, &wfds, &exfds, t); 1352 ret = main_loop_select(max_fd + 1, &rfds, &wfds, &exfds, t);
1327 1353
1328 _ecore_time_loop_time = ecore_time_get(); 1354 _ecore_time_loop_time = ecore_time_get();
1329 if (ret < 0) 1355 if (ret < 0)
1330 { 1356 {
@@ -1335,25 +1361,27 @@ _ecore_main_select(double timeout)
1335 } 1361 }
1336 if (ret > 0) 1362 if (ret > 0)
1337 { 1363 {
1338#ifdef HAVE_EPOLL 1364 if (HAVE_EPOLL && epoll_fd >= 0)
1339 _ecore_main_fdh_poll_mark_active(); 1365 _ecore_main_fdh_epoll_mark_active();
1340#else /* HAVE_EPOLL */ 1366 else
1341 Ecore_Fd_Handler *fdh;
1342
1343 EINA_INLIST_FOREACH(fd_handlers, fdh)
1344 { 1367 {
1345 if (!fdh->delete_me) 1368 Ecore_Fd_Handler *fdh;
1369
1370 EINA_INLIST_FOREACH(fd_handlers, fdh)
1346 { 1371 {
1347 if (FD_ISSET(fdh->fd, &rfds)) 1372 if (!fdh->delete_me)
1348 fdh->read_active = EINA_TRUE; 1373 {
1349 if (FD_ISSET(fdh->fd, &wfds)) 1374 if (FD_ISSET(fdh->fd, &rfds))
1350 fdh->write_active = EINA_TRUE; 1375 fdh->read_active = EINA_TRUE;
1351 if (FD_ISSET(fdh->fd, &exfds)) 1376 if (FD_ISSET(fdh->fd, &wfds))
1352 fdh->error_active = EINA_TRUE; 1377 fdh->write_active = EINA_TRUE;
1353 _ecore_try_add_to_call_list(fdh); 1378 if (FD_ISSET(fdh->fd, &exfds))
1379 fdh->error_active = EINA_TRUE;
1380 _ecore_try_add_to_call_list(fdh);
1381 }
1354 } 1382 }
1355 } 1383 }
1356#endif /* HAVE_EPOLL */ 1384
1357 _ecore_main_fd_handlers_cleanup(); 1385 _ecore_main_fd_handlers_cleanup();
1358#ifdef _WIN32 1386#ifdef _WIN32
1359 _ecore_main_win32_handlers_cleanup(); 1387 _ecore_main_win32_handlers_cleanup();