summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-13 23:23:53 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-13 23:23:53 +0100
commit7707344ddec9069b495b2a5ed41f2104466fc88b (patch)
tree9c6b21f811c7c38a89daf010c61453d7d6eaa8da /src/os_unix.c
parente516c39ee97cb85fa230fbb1b1f54ad1346920d9 (diff)
downloadvim-7707344ddec9069b495b2a5ed41f2104466fc88b.zip
patch 7.4.1315
Problem: Using a channel handle does not allow for freeing it when unused. Solution: Add the Channel variable type.
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 5578cfe2b..01b5a9312 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5043,7 +5043,7 @@ mch_start_job(char **argv, job_T *job)
int fd_in[2]; /* for stdin */
int fd_out[2]; /* for stdout */
int fd_err[2]; /* for stderr */
- int ch_idx;
+ channel_T *channel;
/* default is to fail */
job->jv_status = JOB_FAILED;
@@ -5055,8 +5055,8 @@ mch_start_job(char **argv, job_T *job)
if ((pipe(fd_in) < 0) || (pipe(fd_out) < 0) ||(pipe(fd_err) < 0))
goto failed;
- ch_idx = add_channel();
- if (ch_idx < 0)
+ channel = add_channel();
+ if (channel == NULL)
goto failed;
pid = fork(); /* maybe we should use vfork() */
@@ -5108,14 +5108,14 @@ mch_start_job(char **argv, job_T *job)
/* parent */
job->jv_pid = pid;
job->jv_status = JOB_STARTED;
- job->jv_channel = ch_idx;
+ job->jv_channel = channel;
/* child stdin, stdout and stderr */
close(fd_in[0]);
close(fd_out[1]);
close(fd_err[1]);
- channel_set_pipes(ch_idx, fd_in[1], fd_out[0], fd_err[0]);
- channel_set_job(ch_idx, job);
+ channel_set_pipes(channel, fd_in[1], fd_out[0], fd_err[0]);
+ channel_set_job(channel, job);
return;