summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-05-06 10:33:49 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-05-06 21:44:36 -0700
commit6dde56a016d502cf422b5c54247e225bb13e26d0 (patch)
tree104537d10f9ade00da050d8161f6fd2210ec1ed4 /scope.c
parent80ac8c6d04c04ec1f892883397507f32292ae590 (diff)
downloadxscope-6dde56a016d502cf422b5c54247e225bb13e26d0.tar.gz
Convert select() arguments back to fd_set structures
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
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);
+ }
}
}