Assert fd->fd >= 0
This commit is contained in:
@@ -116,6 +116,7 @@ int iomux_register_fd(struct IOMux *mux, struct IOMuxFD *fd)
|
|||||||
assert(mux != NULL);
|
assert(mux != NULL);
|
||||||
assert(fd != NULL);
|
assert(fd != NULL);
|
||||||
assert(fd->callback != NULL);
|
assert(fd->callback != NULL);
|
||||||
|
assert(fd->fd >= 0);
|
||||||
return mux->register_fd_impl(mux, fd);
|
return mux->register_fd_impl(mux, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +124,7 @@ int iomux_unregister_fd(struct IOMux *mux, struct IOMuxFD *fd)
|
|||||||
{
|
{
|
||||||
assert(mux != NULL);
|
assert(mux != NULL);
|
||||||
assert(fd != NULL);
|
assert(fd != NULL);
|
||||||
|
assert(fd->fd >= 0);
|
||||||
return mux->unregister_fd_impl(mux, fd);
|
return mux->unregister_fd_impl(mux, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,6 +133,7 @@ int iomux_update_events(struct IOMux *mux, struct IOMuxFD *fd)
|
|||||||
assert(mux != NULL);
|
assert(mux != NULL);
|
||||||
assert(fd != NULL);
|
assert(fd != NULL);
|
||||||
assert(fd->callback != NULL);
|
assert(fd->callback != NULL);
|
||||||
|
assert(fd->fd >= 0);
|
||||||
return mux->update_events_impl(mux, fd);
|
return mux->update_events_impl(mux, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user