From: Fredrik Tolf Date: Tue, 20 Sep 2011 15:14:12 +0000 (+0200) Subject: lib: Error out on too many FDs in mtio-select. X-Git-Tag: 0.9~3 X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=commitdiff_plain;h=886fff4d97009253718a65361ebf03fda6c199bd lib: Error out on too many FDs in mtio-select. --- diff --git a/lib/mtio-select.c b/lib/mtio-select.c index eb84a45..63f4e8b 100644 --- a/lib/mtio-select.c +++ b/lib/mtio-select.c @@ -44,6 +44,11 @@ int block(int fd, int ev, time_t to) struct blocker *bl; int rv; + if(fd >= FD_SETSIZE) { + flog(LOG_ERR, "tried to use more file descriptors than select() can handle: fd %i", fd); + errno = EMFILE; + return(-1); + } omalloc(bl); bl->fd = fd; bl->ev = ev;