forked from enlightenment/efl
ecore - be paranoid about storing errno from select immediately
in theory another libc call could overwrite errno between select exiting and errno being used for errors. be paranoid. i know of no real bug that this causes though.
This commit is contained in:
parent
e57084d5c5
commit
1abbfdd1f7
|
@ -1678,8 +1678,7 @@ _ecore_main_select(double timeout)
|
||||||
fd_set rfds, wfds, exfds;
|
fd_set rfds, wfds, exfds;
|
||||||
Ecore_Fd_Handler *fdh;
|
Ecore_Fd_Handler *fdh;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
int max_fd;
|
int max_fd, ret, err_no;
|
||||||
int ret;
|
|
||||||
|
|
||||||
t = NULL;
|
t = NULL;
|
||||||
if ((!ECORE_FINITE(timeout)) || (timeout == 0.0)) /* finite() tests for NaN, too big, too small, and infinity. */
|
if ((!ECORE_FINITE(timeout)) || (timeout == 0.0)) /* finite() tests for NaN, too big, too small, and infinity. */
|
||||||
|
@ -1767,14 +1766,15 @@ _ecore_main_select(double timeout)
|
||||||
|
|
||||||
eina_evlog("!SLEEP", NULL, 0.0, t ? "timeout" : "forever");
|
eina_evlog("!SLEEP", NULL, 0.0, t ? "timeout" : "forever");
|
||||||
ret = main_loop_select(max_fd + 1, &rfds, &wfds, &exfds, t);
|
ret = main_loop_select(max_fd + 1, &rfds, &wfds, &exfds, t);
|
||||||
|
err_no = err_no;
|
||||||
eina_evlog("!WAKE", NULL, 0.0, NULL);
|
eina_evlog("!WAKE", NULL, 0.0, NULL);
|
||||||
|
|
||||||
_ecore_time_loop_time = ecore_time_get();
|
_ecore_time_loop_time = ecore_time_get();
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
if (errno == EINTR) return -1;
|
if (err_no == EINTR) return -1;
|
||||||
else if (errno == EBADF)
|
else if (err_no == EBADF)
|
||||||
_ecore_main_fd_handlers_bads_rem();
|
_ecore_main_fd_handlers_bads_rem();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue