Use select instead of poll to avoid MacOS X bugs

darcs-hash:20051025112247-ac50b-b6c98618716401f39308bdc665401bd34819ce9d.gz
This commit is contained in:
axel 2005-10-25 21:22:47 +10:00
parent ddcb84aa07
commit a9bf64465c

View file

@ -2389,14 +2389,12 @@ static int read_i()
*/
static int can_read( int fd )
{
struct pollfd pfd[] =
{
{
fd, POLLIN, 0
}
}
;
return poll( pfd, 1, 0 ) == 1;
struct timeval can_read_timeout = { 0, 0 };
fd_set fds;
FD_ZERO(&fds);
FD_SET(fd, &fds);
return select(fd + 1, &fds, 0, 0, &can_read_timeout) == 1;
}
/**