summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-11 22:19:44 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-11 22:19:44 +0100
commitde27989157f35172b25f9e01e0c147ed8f6ae3ce (patch)
treeac52ee2ae7bf82a4cc85f31b1c7b6f2993348c81 /src/os_win32.c
parent9e496854a9fe56699687a4f86003fad115b3b375 (diff)
downloadvim-git-de27989157f35172b25f9e01e0c147ed8f6ae3ce.tar.gz
patch 7.4.1536v7.4.1536
Problem: Cannot re-use a channel for another job. Solution: Add the "channel" option to job_start().
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index c4dc349a3..49fd0f703 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -5138,7 +5138,14 @@ mch_start_job(char *cmd, job_T *job, jobopt_T *options)
if (!use_null_for_in || !use_null_for_out || !use_null_for_err)
{
- channel = add_channel();
+ if (options->jo_set & JO_CHANNEL)
+ {
+ channel = options->jo_channel;
+ if (channel != NULL)
+ ++channel->ch_refcount;
+ }
+ else
+ channel = add_channel();
if (channel == NULL)
goto failed;
}
@@ -5188,9 +5195,6 @@ mch_start_job(char *cmd, job_T *job, jobopt_T *options)
use_out_for_err || use_file_for_err || use_null_for_err
? INVALID_FD : (sock_T)efd[0]);
channel_set_job(channel, job, options);
-# ifdef FEAT_GUI
- channel_gui_register(channel);
-# endif
}
# endif
return;
@@ -5203,7 +5207,7 @@ failed:
CloseHandle(ifd[1]);
CloseHandle(ofd[1]);
CloseHandle(efd[1]);
- channel_free(channel);
+ channel_unref(channel);
# else
; /* make compiler happy */
# endif