diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-05-06 10:33:49 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-05-06 21:44:36 -0700 |
commit | 6dde56a016d502cf422b5c54247e225bb13e26d0 (patch) | |
tree | 104537d10f9ade00da050d8161f6fd2210ec1ed4 /scope.c | |
parent | 80ac8c6d04c04ec1f892883397507f32292ae590 (diff) | |
download | xscope-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.c | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -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); + } } } |