Enable specifying no events when registring with the iomux
This commit is contained in:
+1
-11
@@ -59,16 +59,6 @@ static int iomux_epoll_update_events(struct IOMux *mux_, struct IOMuxFD *fd)
|
||||
struct epoll_event e_event = {0, {0}};
|
||||
int rc;
|
||||
|
||||
//if we EPOLL_CTL_MOD with events of 0, epoll
|
||||
//will still wait for HUP/ERR , which can lead to
|
||||
//strange things. (e.g. updating fd->what to 0 on a pipe
|
||||
//in order to try to "pause" reading can lead to missing or false
|
||||
//read events.
|
||||
assert(fd->what != 0);
|
||||
if (fd->what == 0)
|
||||
return EINVAL;
|
||||
|
||||
|
||||
e_event.events = mux_2_epoll_events(fd->what);
|
||||
e_event.data.ptr = fd;
|
||||
|
||||
@@ -86,7 +76,7 @@ static int iomux_epoll_register_fd(struct IOMux *mux_, struct IOMuxFD *fd)
|
||||
struct epoll_event e_event = {0, {0}};
|
||||
int rc;
|
||||
|
||||
if (fd->what == 0 || fd->callback == NULL)
|
||||
if (fd->callback == NULL)
|
||||
return EINVAL;
|
||||
|
||||
e_event.events = mux_2_epoll_events(fd->what);
|
||||
|
||||
Reference in New Issue
Block a user