Skip to content

Commit

Permalink
patch 8.0.0964: channel write buffer does not work with poll()
Browse files Browse the repository at this point in the history
Problem:    Channel write buffer does not work with poll().
Solution:   Use the same mechanism as with select().
  • Loading branch information
brammool committed Aug 19, 2017
1 parent d21f8b5 commit 683b796
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/channel.c
Expand Up @@ -3018,7 +3018,9 @@ channel_fill_poll_write(int nfd_in, struct pollfd *fds)
{ {
chanpart_T *in_part = &ch->ch_part[PART_IN]; chanpart_T *in_part = &ch->ch_part[PART_IN];


if (in_part->ch_fd != INVALID_FD && in_part->ch_bufref.br_buf != NULL) if (in_part->ch_fd != INVALID_FD
&& (in_part->ch_bufref.br_buf != NULL
|| in_part->ch_writeque.wq_next != NULL))
{ {
in_part->ch_poll_idx = nfd; in_part->ch_poll_idx = nfd;
fds[nfd].fd = in_part->ch_fd; fds[nfd].fd = in_part->ch_fd;
Expand Down Expand Up @@ -3946,13 +3948,7 @@ channel_poll_check(int ret_in, void *fds_in)
idx = in_part->ch_poll_idx; idx = in_part->ch_poll_idx;
if (ret > 0 && idx != -1 && (fds[idx].revents & POLLOUT)) if (ret > 0 && idx != -1 && (fds[idx].revents & POLLOUT))
{ {
if (in_part->ch_buf_append) channel_write_input(channel);
{
if (in_part->ch_bufref.br_buf != NULL)
channel_write_new_lines(in_part->ch_bufref.br_buf);
}
else
channel_write_in(channel);
--ret; --ret;
} }
} }
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -769,6 +769,8 @@ static char *(features[]) =


static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
964,
/**/ /**/
963, 963,
/**/ /**/
Expand Down

0 comments on commit 683b796

Please sign in to comment.