#include "Select.h"
#include "AwaitEvent.h"
+# ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+# endif
+
# ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
case BlockedOnRead:
{
int fd = tso->block_info.fd;
- if (fd >= (int)FD_SETSIZE) {
+ if ((fd >= (int)FD_SETSIZE) || (fd < 0)) {
barf("awaitEvent: descriptor out of range");
}
maxfd = (fd > maxfd) ? fd : maxfd;
case BlockedOnWrite:
{
int fd = tso->block_info.fd;
- if (fd >= (int)FD_SETSIZE) {
+ if ((fd >= (int)FD_SETSIZE) || (fd < 0)) {
barf("awaitEvent: descriptor out of range");
}
maxfd = (fd > maxfd) ? fd : maxfd;