Commit b27a416b authored by simonmar's avatar simonmar
Browse files

[project @ 2005-11-30 15:58:47 by simonmar]

check for overrun of the fd_set, some OSs give you more descriptors
than FD_SETSIZE
parent 10dd2a6d
......@@ -144,6 +144,9 @@ awaitEvent(rtsBool wait)
case BlockedOnRead:
{
int fd = tso->block_info.fd;
if (fd >= FD_SETSIZE) {
barf("awaitEvent: descriptor out of range");
}
maxfd = (fd > maxfd) ? fd : maxfd;
FD_SET(fd, &rfd);
continue;
......@@ -152,6 +155,9 @@ awaitEvent(rtsBool wait)
case BlockedOnWrite:
{
int fd = tso->block_info.fd;
if (fd >= FD_SETSIZE) {
barf("awaitEvent: descriptor out of range");
}
maxfd = (fd > maxfd) ? fd : maxfd;
FD_SET(fd, &wfd);
continue;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment