changeset 9131:3507fde33e6e v7.4.1849

commit https://github.com/vim/vim/commit/5850a764eae74a4dae7238e4e76b4c24f062699b Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 27 19:59:48 2016 +0200 patch 7.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.
author Christian Brabandt <cb@256bit.org>
date Fri, 27 May 2016 20:00:07 +0200
parents 3924acee7349
children 09a77387f1d9
files src/channel.c src/version.c
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -2893,6 +2893,10 @@ channel_read(channel_T *channel, int par
     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)
 	{
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1849,
+/**/
     1848,
 /**/
     1847,