forked from enlightenment/efl
revert pselect - breaks e init and entrance
SVN revision: 33829
This commit is contained in:
parent
c31c2c50c3
commit
9d31648720
|
@ -284,35 +284,34 @@ _ecore_main_shutdown(void)
|
||||||
static int
|
static int
|
||||||
_ecore_main_select(double timeout)
|
_ecore_main_select(double timeout)
|
||||||
{
|
{
|
||||||
sigset_t emptyset;
|
struct timeval tv, *t;
|
||||||
struct timespec ts, *t;
|
fd_set rfds, wfds, exfds;
|
||||||
fd_set rfds, wfds, exfds;
|
int max_fd;
|
||||||
int max_fd;
|
int ret;
|
||||||
int ret;
|
Ecore_List2 *l;
|
||||||
Ecore_List2 *l;
|
|
||||||
|
|
||||||
t = NULL;
|
t = NULL;
|
||||||
if ((!finite(timeout)) || (timeout == 0.0)) /* finite() tests for NaN, too big, too small, and infinity. */
|
if ((!finite(timeout)) || (timeout == 0.0)) /* finite() tests for NaN, too big, too small, and infinity. */
|
||||||
{
|
{
|
||||||
ts.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
ts.tv_nsec = 0;
|
tv.tv_usec = 0;
|
||||||
t = &ts;
|
t = &tv;
|
||||||
}
|
}
|
||||||
else if (timeout > 0.0)
|
else if (timeout > 0.0)
|
||||||
{
|
{
|
||||||
int sec, nsec;
|
int sec, usec;
|
||||||
|
|
||||||
#ifdef FIX_HZ
|
#ifdef FIX_HZ
|
||||||
timeout += (0.5 / HZ);
|
timeout += (0.5 / HZ);
|
||||||
sec = (int)timeout;
|
sec = (int)timeout;
|
||||||
nsec = (int)((timeout - (double)sec) * 1000000000);
|
usec = (int)((timeout - (double)sec) * 1000000);
|
||||||
#else
|
#else
|
||||||
sec = (int)timeout;
|
sec = (int)timeout;
|
||||||
nsec = (int)((timeout - (double)sec) * 1000000000);
|
usec = (int)((timeout - (double)sec) * 1000000);
|
||||||
#endif
|
#endif
|
||||||
ts.tv_sec = sec;
|
tv.tv_sec = sec;
|
||||||
ts.tv_nsec = nsec;
|
tv.tv_usec = usec;
|
||||||
t = &ts;
|
t = &tv;
|
||||||
}
|
}
|
||||||
max_fd = 0;
|
max_fd = 0;
|
||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
|
@ -351,9 +350,7 @@ _ecore_main_select(double timeout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_ecore_signal_count_get()) return -1;
|
if (_ecore_signal_count_get()) return -1;
|
||||||
sigemptyset(&emptyset);
|
ret = select(max_fd + 1, &rfds, &wfds, &exfds, t);
|
||||||
ret = pselect(max_fd + 1, &rfds, &wfds, &exfds, t, &emptyset);
|
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
if (errno == EINTR) return -1;
|
if (errno == EINTR) return -1;
|
||||||
|
|
|
@ -113,32 +113,10 @@ _ecore_signal_shutdown(void)
|
||||||
void
|
void
|
||||||
_ecore_signal_init(void)
|
_ecore_signal_init(void)
|
||||||
{
|
{
|
||||||
sigset_t blockset;
|
|
||||||
int ret;
|
|
||||||
#ifdef SIGRTMIN
|
#ifdef SIGRTMIN
|
||||||
int i, num = SIGRTMAX - SIGRTMIN;
|
int i, num = SIGRTMAX - SIGRTMIN;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sigemptyset(&blockset);
|
|
||||||
sigaddset(&blockset, SIGPIPE);
|
|
||||||
sigaddset(&blockset, SIGALRM);
|
|
||||||
sigaddset(&blockset, SIGCHLD);
|
|
||||||
sigaddset(&blockset, SIGUSR1);
|
|
||||||
sigaddset(&blockset, SIGUSR2);
|
|
||||||
sigaddset(&blockset, SIGHUP);
|
|
||||||
sigaddset(&blockset, SIGQUIT);
|
|
||||||
sigaddset(&blockset, SIGINT);
|
|
||||||
sigaddset(&blockset, SIGTERM);
|
|
||||||
#ifdef SIGPWR
|
|
||||||
sigaddset(&blockset, SIGPWR);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SIGRTMIN
|
|
||||||
for (i = 0; i < num; i++)
|
|
||||||
sigaddset(&blockset, SIGRTMIN + i);
|
|
||||||
#endif
|
|
||||||
sigprocmask(SIG_BLOCK, &blockset, NULL);
|
|
||||||
|
|
||||||
_ecore_signal_callback_set(SIGPIPE, _ecore_signal_callback_ignore);
|
_ecore_signal_callback_set(SIGPIPE, _ecore_signal_callback_ignore);
|
||||||
_ecore_signal_callback_set(SIGALRM, _ecore_signal_callback_ignore);
|
_ecore_signal_callback_set(SIGALRM, _ecore_signal_callback_ignore);
|
||||||
_ecore_signal_callback_set(SIGCHLD, _ecore_signal_callback_sigchld);
|
_ecore_signal_callback_set(SIGCHLD, _ecore_signal_callback_sigchld);
|
||||||
|
|
Loading…
Reference in New Issue