From 14b995a71a1ece89597578975b39c29cff6a95c6 Mon Sep 17 00:00:00 2001 From: ichizok Date: Thu, 22 Mar 2018 20:13:58 +0900 Subject: [PATCH] Don't associate a single fd with both out and err Or the order of ch-out and ch-err about dispatch-read and write-to-buffer would be inconsistent. --- src/channel.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/channel.c b/src/channel.c index 926163d22b..af0249ab17 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1028,11 +1028,18 @@ channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err) channel_gui_unregister_one(channel, PART_ERR); # endif ch_close_part(channel, PART_ERR); - channel->CH_ERR_FD = err; - channel->ch_to_be_closed |= (1 << PART_ERR); -# if defined(FEAT_GUI) - channel_gui_register_one(channel, PART_ERR); +# if defined(FEAT_GUI_MACVIM) + if (err == out && gui.in_use) + channel->CH_ERR_FD = INVALID_FD; + else # endif + { + channel->CH_ERR_FD = err; + channel->ch_to_be_closed |= (1 << PART_ERR); +# if defined(FEAT_GUI) + channel_gui_register_one(channel, PART_ERR); +# endif + } } }