Have iomux_update_events be a no-op if the events didn't change
This commit is contained in:
+10
-2
@@ -130,13 +130,21 @@ int iomux_unregister_fd(struct IOMux *mux, struct IOMuxFD *fd)
|
||||
return mux->unregister_fd_impl(mux, fd);
|
||||
}
|
||||
|
||||
int iomux_update_events(struct IOMux *mux, struct IOMuxFD *fd)
|
||||
int iomux_update_events(struct IOMux *mux, struct IOMuxFD *fd, unsigned int what)
|
||||
{
|
||||
int rc;
|
||||
assert(mux != NULL);
|
||||
assert(fd != NULL);
|
||||
assert(fd->callback != NULL);
|
||||
assert(fd->fd >= 0);
|
||||
return mux->update_events_impl(mux, fd);
|
||||
|
||||
if (fd->what != what) {
|
||||
mux->update_events_impl(mux, fd);
|
||||
} else {
|
||||
rc = 0;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
struct UCoreClock *iomux_get_clock(struct IOMux *mux)
|
||||
|
||||
Reference in New Issue
Block a user