]> granicus.if.org Git - vim/commitdiff
patch 8.0.0964: channel write buffer does not work with poll() v8.0.0964
authorBram Moolenaar <Bram@vim.org>
Sat, 19 Aug 2017 13:51:59 +0000 (15:51 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 19 Aug 2017 13:51:59 +0000 (15:51 +0200)
Problem:    Channel write buffer does not work with poll().
Solution:   Use the same mechanism as with select().

src/channel.c
src/version.c

index 9a14e1ed3ff98004d1ede55d0bcbef70060669d8..79cca795f31f5d2204499b0bf0b4c8469d826661 100644 (file)
@@ -3018,7 +3018,9 @@ channel_fill_poll_write(int nfd_in, struct pollfd *fds)
     {
        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;
            fds[nfd].fd = in_part->ch_fd;
@@ -3946,13 +3948,7 @@ channel_poll_check(int ret_in, void *fds_in)
        idx = in_part->ch_poll_idx;
        if (ret > 0 && idx != -1 && (fds[idx].revents & POLLOUT))
        {
-           if (in_part->ch_buf_append)
-           {
-               if (in_part->ch_bufref.br_buf != NULL)
-                   channel_write_new_lines(in_part->ch_bufref.br_buf);
-           }
-           else
-               channel_write_in(channel);
+           channel_write_input(channel);
            --ret;
        }
     }
index e6626cb166f1498ef9409dd912b1c7461e5b5774..291ccdff830575f3a651e94ac24162d2bba8a59c 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    964,
 /**/
     963,
 /**/