summaryrefslogtreecommitdiff
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-05-27 19:59:48 +0200
committerBram Moolenaar <Bram@vim.org>2016-05-27 19:59:48 +0200
commit5850a764eae74a4dae7238e4e76b4c24f062699b (patch)
tree04dbdc63212800f54032c900fc035fffd8e27893 /src/channel.c
parent6727bf861776cfbb93c97dfea5f87a095cf9f364 (diff)
downloadvim-git-5850a764eae74a4dae7238e4e76b4c24f062699b.tar.gz
patch 7.4.1849v7.4.1849
Problem: Still trying to read from channel that is going to be closed. (Ramel Eshed) Solution: Check if ch_to_be_closed is set.
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/channel.c b/src/channel.c
index a5a84dc9c..84dfcf7c0 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -2893,6 +2893,10 @@ channel_read(channel_T *channel, int part, char *func)
sock_T fd;
int use_socket = FALSE;
+ /* If we detected a read error don't try reading again. */
+ if (channel->ch_to_be_closed)
+ return;
+
fd = channel->ch_part[part].ch_fd;
if (fd == INVALID_FD)
{
@@ -3193,6 +3197,10 @@ channel_handle_events(void)
for (channel = first_channel; channel != NULL; channel = channel->ch_next)
{
+ /* If we detected a read error don't try reading again. */
+ if (channel->ch_to_be_closed)
+ continue;
+
/* check the socket and pipes */
for (part = PART_SOCK; part <= PART_ERR; ++part)
{