diff --git a/src/iomux_impl.c b/src/iomux_impl.c index f94e0c9..2f41aa6 100644 --- a/src/iomux_impl.c +++ b/src/iomux_impl.c @@ -116,6 +116,7 @@ int iomux_register_fd(struct IOMux *mux, struct IOMuxFD *fd) assert(mux != NULL); assert(fd != NULL); assert(fd->callback != NULL); + assert(fd->fd >= 0); 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(fd != NULL); + assert(fd->fd >= 0); 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(fd != NULL); assert(fd->callback != NULL); + assert(fd->fd >= 0); return mux->update_events_impl(mux, fd); }