[project @ 2006-01-18 10:31:50 by simonmar]
[ghc-hetmet.git] / ghc / rts / posix / Select.c
index 8dfafe2..effc7c4 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;
@@ -202,7 +208,7 @@ awaitEvent(rtsBool wait)
           */
 #if defined(RTS_USER_SIGNALS)
          if (signals_pending()) {
-             startSignalHandlers();
+             startSignalHandlers(&MainCapability);
              return; /* still hold the lock */
          }
 #endif