revert pselect - breaks e init and entrance

SVN revision: 33829
This commit is contained in:
Carsten Haitzler 2008-02-24 08:42:39 +00:00
parent c31c2c50c3
commit 9d31648720
2 changed files with 15 additions and 40 deletions

View File

@ -284,35 +284,34 @@ _ecore_main_shutdown(void)
static int
_ecore_main_select(double timeout)
{
sigset_t emptyset;
struct timespec ts, *t;
fd_set rfds, wfds, exfds;
int max_fd;
int ret;
Ecore_List2 *l;
struct timeval tv, *t;
fd_set rfds, wfds, exfds;
int max_fd;
int ret;
Ecore_List2 *l;
t = NULL;
if ((!finite(timeout)) || (timeout == 0.0)) /* finite() tests for NaN, too big, too small, and infinity. */
{
ts.tv_sec = 0;
ts.tv_nsec = 0;
t = &ts;
tv.tv_sec = 0;
tv.tv_usec = 0;
t = &tv;
}
else if (timeout > 0.0)
{
int sec, nsec;
int sec, usec;
#ifdef FIX_HZ
timeout += (0.5 / HZ);
sec = (int)timeout;
nsec = (int)((timeout - (double)sec) * 1000000000);
usec = (int)((timeout - (double)sec) * 1000000);
#else
sec = (int)timeout;
nsec = (int)((timeout - (double)sec) * 1000000000);
usec = (int)((timeout - (double)sec) * 1000000);
#endif
ts.tv_sec = sec;
ts.tv_nsec = nsec;
t = &ts;
tv.tv_sec = sec;
tv.tv_usec = usec;
t = &tv;
}
max_fd = 0;
FD_ZERO(&rfds);
@ -351,9 +350,7 @@ _ecore_main_select(double timeout)
}
}
if (_ecore_signal_count_get()) return -1;
sigemptyset(&emptyset);
ret = pselect(max_fd + 1, &rfds, &wfds, &exfds, t, &emptyset);
ret = select(max_fd + 1, &rfds, &wfds, &exfds, t);
if (ret < 0)
{
if (errno == EINTR) return -1;

View File

@ -113,32 +113,10 @@ _ecore_signal_shutdown(void)
void
_ecore_signal_init(void)
{
sigset_t blockset;
int ret;
#ifdef SIGRTMIN
int i, num = SIGRTMAX - SIGRTMIN;
#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(SIGALRM, _ecore_signal_callback_ignore);
_ecore_signal_callback_set(SIGCHLD, _ecore_signal_callback_sigchld);