forked from enlightenment/efl
ecore_pipe: add write fdset and except fdset.
ecore_pipe_wait can be run not only select but also _ecore_glib_select__locked. if write fdset is null, it make problem in FD_ISSET. @fix
This commit is contained in:
parent
658a51b3ac
commit
bd8f585d74
|
@ -424,7 +424,7 @@ _ecore_pipe_wait(Ecore_Pipe *p,
|
||||||
double wait)
|
double wait)
|
||||||
{
|
{
|
||||||
struct timeval tv, *t;
|
struct timeval tv, *t;
|
||||||
fd_set rset;
|
fd_set rset, wset, exset;
|
||||||
double end = 0.0;
|
double end = 0.0;
|
||||||
double timeout;
|
double timeout;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -435,6 +435,8 @@ _ecore_pipe_wait(Ecore_Pipe *p,
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
FD_ZERO(&rset);
|
FD_ZERO(&rset);
|
||||||
|
FD_ZERO(&wset);
|
||||||
|
FD_ZERO(&exset);
|
||||||
FD_SET(p->fd_read, &rset);
|
FD_SET(p->fd_read, &rset);
|
||||||
|
|
||||||
if (wait >= 0.0)
|
if (wait >= 0.0)
|
||||||
|
@ -472,7 +474,7 @@ _ecore_pipe_wait(Ecore_Pipe *p,
|
||||||
t = NULL;
|
t = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = main_loop_select(p->fd_read + 1, &rset, NULL, NULL, t);
|
ret = main_loop_select(p->fd_read + 1, &rset, &wset, &exset, t);
|
||||||
|
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue