Propagate error back from iomux_select_update_events

This commit is contained in:
Nils O. Selåsdal
2016-12-07 20:57:59 +01:00
parent 422667aa7e
commit a6fe01978c
+2 -2
View File
@@ -44,7 +44,7 @@ static int iomux_select_update_events(struct IOMux *mux_, struct IOMuxFD *fd)
struct IOMuxSelect *mux = mux_->instance; struct IOMuxSelect *mux = mux_->instance;
if (fd->fd < 0 || fd->fd >= FD_SETSIZE) { if (fd->fd < 0 || fd->fd >= FD_SETSIZE) {
return EINVAL; return ENFILE;
} }
if (fd->what & MUX_EV_READ) 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); rc = iomux_select_update_events(mux_, fd);
if (rc != 0) { if (rc != 0) {
return ENFILE; return rc;
} }
mux->descriptors[fd->fd] = fd; mux->descriptors[fd->fd] = fd;