Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f43decc
)
lib: Error out on too many FDs in mtio-select.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 20 Sep 2011 15:14:12 +0000
(17:14 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 20 Sep 2011 15:14:12 +0000
(17:14 +0200)
lib/mtio-select.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/mtio-select.c
b/lib/mtio-select.c
index
eb84a45
..
63f4e8b
100644
(file)
--- 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;