From a6fe01978cd115919606268762b9b31044b299d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Wed, 7 Dec 2016 20:57:59 +0100 Subject: [PATCH] Propagate error back from iomux_select_update_events --- src/iomux_select.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;