From a9bf64465cedde1c89c0001e6b649d28fde3ea5a Mon Sep 17 00:00:00 2001 From: axel Date: Tue, 25 Oct 2005 21:22:47 +1000 Subject: [PATCH] Use select instead of poll to avoid MacOS X bugs darcs-hash:20051025112247-ac50b-b6c98618716401f39308bdc665401bd34819ce9d.gz --- reader.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/reader.c b/reader.c index 85dbaf407..3057a35c1 100644 --- a/reader.c +++ b/reader.c @@ -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; } /**