From 6dde56a016d502cf422b5c54247e225bb13e26d0 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 6 May 2009 10:33:49 -0700 Subject: Convert select() arguments back to fd_set structures Signed-off-by: Alan Coopersmith --- scope.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'scope.c') 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); + } } } -- cgit v1.2.1