Index: src/xstd/Select.cc =================================================================== RCS file: /usr/local/CVS/polygraph/src/xstd/Select.cc,v retrieving revision 1.2.2.5 diff -u -r1.2.2.5 Select.cc --- src/xstd/Select.cc 2001/06/18 17:26:27 1.2.2.5 +++ src/xstd/Select.cc 2001/06/25 14:52:25 @@ -87,6 +87,7 @@ // have to check all fds, cannot choose like poll() does const int hotCount = theMaxFD+1; + fd_set *rdSet = theSets[dirRead].makeReadySet(); fd_set *wrSet = theSets[dirWrite].makeReadySet(); fd_set *excSet = 0; # if defined(WIN32) @@ -97,14 +98,17 @@ static fd_set es; es = *wrSet; excSet = &es; + } else + if (!rdSet) { + // Windows select(2) fails if no FDs are checked for + // we must emulate sleep instead of calling select(2) + if (timeout) + sleep(timeout->sec()); + return 0; } # endif - const int res = ::select(hotCount, - theSets[dirRead].makeReadySet(), - wrSet, - excSet, - timeout); + const int res = ::select(hotCount, rdSet, wrSet, excSet, timeout); # if defined(WIN32) if (res > 0 && excSet && wrSet) {