diff --git a/src/iomux_select.c b/src/iomux_select.c index 488450b..9f71773 100644 --- a/src/iomux_select.c +++ b/src/iomux_select.c @@ -44,7 +44,7 @@ static int iomux_select_update_events(struct IOMux *mux_, struct IOMuxFD *fd) struct IOMuxSelect *mux = mux_->instance; if (fd->fd < 0 || fd->fd >= FD_SETSIZE) { - return EINVAL; + return ENFILE; } if (fd->what & MUX_EV_READ) @@ -70,7 +70,7 @@ static int iomux_select_register_fd(struct IOMux *mux_, struct IOMuxFD *fd) rc = iomux_select_update_events(mux_, fd); if (rc != 0) { - return ENFILE; + return rc; } mux->descriptors[fd->fd] = fd;