mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Use select instead of poll to avoid MacOS X bugs
darcs-hash:20051025112247-ac50b-b6c98618716401f39308bdc665401bd34819ce9d.gz
This commit is contained in:
parent
ddcb84aa07
commit
a9bf64465c
1 changed files with 6 additions and 8 deletions
14
reader.c
14
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue