]> granicus.if.org Git - vim/commitdiff
patch 7.4.1625 v7.4.1625
authorBram Moolenaar <Bram@vim.org>
Sun, 20 Mar 2016 20:02:00 +0000 (21:02 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 20 Mar 2016 20:02:00 +0000 (21:02 +0100)
Problem:    Trying to close file descriptor that isn't open.
Solution:   Check for negative number.

src/os_unix.c
src/version.c

index 4cc9de7c46461e869e02500fb309ae0535b40e8c..cda5407f83834884f6bad3adcaafc385de3fc991 100644 (file)
@@ -5214,11 +5214,11 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED)
     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)
     {
index d465d8151bd46f7953932f4f6c98bc10bd4caebb..7e1b515ab445a44d0c9bcd3b0804a943691a4654 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1625,
 /**/
     1624,
 /**/