summaryrefslogtreecommitdiff
path: root/src/libstddjb/iopause_select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/iopause_select.c')
-rw-r--r--src/libstddjb/iopause_select.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstddjb/iopause_select.c b/src/libstddjb/iopause_select.c
index 8b8479b..a98767c 100644
--- a/src/libstddjb/iopause_select.c
+++ b/src/libstddjb/iopause_select.c
@@ -35,6 +35,7 @@ int iopause_select (iopause_fd *x, unsigned int len, tain_t const *deadline, tai
x[i].revents = 0 ;
if (x[i].fd >= 0)
{
+ if (x[i].fd >= FD_SETSIZE) return (errno = EMFILE, -1) ;
if (x[i].fd >= nfds) nfds = x[i].fd + 1 ;
if (x[i].events & IOPAUSE_READ) FD_SET(x[i].fd, &rfds) ;
if (x[i].events & IOPAUSE_WRITE) FD_SET(x[i].fd, &wfds) ;