mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-05-28 00:21:57 +02:00
Check socket using select prior to call channel_read
This commit is contained in:
@@ -3463,7 +3463,14 @@ static void socketReadCallback(CFSocketRef s,
|
||||
|
||||
- (void)read
|
||||
{
|
||||
channel_read(channel, part, "MMChannel_read");
|
||||
int fd = channel->ch_part[part].ch_fd;
|
||||
fd_set fds;
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(fd, &fds);
|
||||
struct timeval t;
|
||||
memset(&t, 0, sizeof(t));
|
||||
if (select(FD_SETSIZE, &fds, NULL, NULL, &t) > 0)
|
||||
channel_read(channel, part, "MMChannel_read");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user