Assert fd->fd >= 0

This commit is contained in:
Nils O. Selåsdal
2013-12-17 23:11:58 +01:00
parent a681e9044f
commit 52addceff2
+3
View File
@@ -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);
} }