summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/scope.c b/scope.c
index 9596042..3a30ce1 100644
--- a/scope.c
+++ b/scope.c
@@ -106,9 +106,9 @@ int Interrupt = 0;
struct FDDescriptor *FDD = 0;
short MaxFD = 0;
short nFDsInUse = 0;
-long ReadDescriptors = 0;
-long WriteDescriptors = 0;
-long BlockedReadDescriptors;
+fd_set ReadDescriptors;
+fd_set WriteDescriptors;
+fd_set BlockedReadDescriptors;
short HighestFD;
short debuglevel = 0;
@@ -1075,17 +1075,20 @@ FlushFD (
}
if (FDinfo[fd].bufstart == FDinfo[fd].bufcount)
{
- if (PeerFD >= 0)
- BlockedReadDescriptors &= ~ (1 << PeerFD);
- WriteDescriptors &= ~(1 << fd);
+ if (PeerFD >= 0) {
+ FD_CLR(PeerFD, &BlockedReadDescriptors);
+ }
+ FD_CLR(fd, &WriteDescriptors);
FDinfo[fd].bufcount = FDinfo[fd].bufstart = 0;
}
else
{
- if (PeerFD >= 0)
- BlockedReadDescriptors |= 1 << PeerFD;
- if (FDinfo[fd].buflimit != FDinfo[fd].bufdelivered)
- WriteDescriptors |= 1 << fd;
+ if (PeerFD >= 0) {
+ FD_SET(PeerFD, &BlockedReadDescriptors);
+ }
+ if (FDinfo[fd].buflimit != FDinfo[fd].bufdelivered) {
+ FD_SET(PeerFD, &WriteDescriptors);
+ }
}
}