Mercurial > vim
changeset 8671:8f6bc5626829 v7.4.1625
commit https://github.com/vim/vim/commit/be6aa46c4d8948e164f7d181dc19ed2fc4818395
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 20 21:02:00 2016 +0100
patch 7.4.1625
Problem: Trying to close file descriptor that isn't open.
Solution: Check for negative number.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 20 Mar 2016 21:15:05 +0100 |
parents | 251ab6b09b05 |
children | 7d1058fed5fb |
files | src/os_unix.c src/version.c |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -5214,11 +5214,11 @@ mch_start_job(char **argv, job_T *job, j job->jv_channel = channel; /* ch_refcount was set above */ /* child stdin, stdout and stderr */ - if (!use_file_for_in) + if (!use_file_for_in && fd_in[0] >= 0) close(fd_in[0]); - if (!use_file_for_out) + if (!use_file_for_out && fd_out[1] >= 0) close(fd_out[1]); - if (!use_out_for_err && !use_file_for_err) + if (!use_out_for_err && !use_file_for_err && fd_err[1] >= 0) close(fd_err[1]); if (channel != NULL) {