[project @ 2005-11-30 15:58:47 by simonmar]
[ghc-hetmet.git] / ghc / rts / posix / Select.c
index 8dfafe2..0f7a6df 100644 (file)
@@ -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;