Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.dolda2000.com:/srv/git/r/ashd
[ashd.git]
/
lib
/
mtio-select.c
diff --git
a/lib/mtio-select.c
b/lib/mtio-select.c
index
eb84a45
..
6536c95
100644
(file)
--- a/
lib/mtio-select.c
+++ b/
lib/mtio-select.c
@@
-18,6
+18,8
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
+#include <unistd.h>
#include <errno.h>
#include <sys/select.h>
#include <errno.h>
#include <sys/select.h>
@@
-44,6
+46,11
@@
int block(int fd, int ev, time_t to)
struct blocker *bl;
int rv;
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;
omalloc(bl);
bl->fd = fd;
bl->ev = ev;