diff options
author | axel <axel@liljencrantz.se> | 2005-10-25 21:22:47 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2005-10-25 21:22:47 +1000 |
commit | a9bf64465cedde1c89c0001e6b649d28fde3ea5a (patch) | |
tree | 6b83a36eec8a464875b2df317eef11aba435b720 /reader.c | |
parent | ddcb84aa07607bbd274edb89ddc4371d8d7aa27f (diff) |
Use select instead of poll to avoid MacOS X bugs
darcs-hash:20051025112247-ac50b-b6c98618716401f39308bdc665401bd34819ce9d.gz
Diffstat (limited to 'reader.c')
-rw-r--r-- | reader.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -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; } /** |