Have iomux_update_events be a no-op if the events didn't change

This commit is contained in:
Nils O. Selåsdal
2013-12-26 03:20:47 +01:00
parent 9756ca0aeb
commit 0bb42dc235
2 changed files with 15 additions and 17 deletions
+10 -2
View File
@@ -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)