]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1495 v7.4.1495
authorBram Moolenaar <Bram@vim.org>
Sat, 5 Mar 2016 21:05:27 +0000 (22:05 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 5 Mar 2016 21:05:27 +0000 (22:05 +0100)
Problem:    Compiler warnings when building on Unix with the job feature but
            without the channel feature.
Solution:   Move #ifdefs. (Dominique Pelle)

src/os_unix.c
src/version.c

index bcfffb425f0e1874b21f2456b0d0f6144d462955..ed2b1298cdcbb005090e0dc76c094ea1135f148e 100644 (file)
@@ -5037,16 +5037,15 @@ error:
 
 #if defined(FEAT_JOB) || defined(PROTO)
     void
-mch_start_job(char **argv, job_T *job, jobopt_T *options)
+mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED)
 {
     pid_t      pid;
+# ifdef FEAT_CHANNEL
     int                fd_in[2];       /* for stdin */
     int                fd_out[2];      /* for stdout */
     int                fd_err[2];      /* for stderr */
-# ifdef FEAT_CHANNEL
     channel_T  *channel = NULL;
     int                use_out_for_err = options->jo_io[PART_ERR] == JIO_OUT;
-#endif
 
     /* default is to fail */
     job->jv_status = JOB_FAILED;
@@ -5055,7 +5054,6 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options)
     fd_err[0] = -1;
 
     /* TODO: without the channel feature connect the child to /dev/null? */
-# ifdef FEAT_CHANNEL
     /* Open pipes for stdin, stdout, stderr. */
     if (pipe(fd_in) < 0 || pipe(fd_out) < 0
                                    || (!use_out_for_err && pipe(fd_err) < 0))
@@ -5114,7 +5112,6 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options)
        close(1);
        ignored = dup(fd_out[1]);
        close(fd_out[1]);
-
 # endif
 
        /* See above for type of argv. */
@@ -5131,14 +5128,12 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options)
     job->jv_channel = channel;
 # endif
 
+# ifdef FEAT_CHANNEL
     /* child stdin, stdout and stderr */
     close(fd_in[0]);
     close(fd_out[1]);
-# ifdef FEAT_CHANNEL
     if (!use_out_for_err)
-# endif
        close(fd_err[1]);
-# ifdef FEAT_CHANNEL
     channel_set_pipes(channel, fd_in[1], fd_out[0],
                                    use_out_for_err ? INVALID_FD : fd_err[0]);
     channel_set_job(channel, job, options);
@@ -5149,11 +5144,10 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options)
 
     return;
 
-failed:
+failed: ;
 # ifdef FEAT_CHANNEL
     if (channel != NULL)
        channel_free(channel);
-# endif
     if (fd_in[0] >= 0)
     {
        close(fd_in[0]);
@@ -5169,6 +5163,7 @@ failed:
        close(fd_err[0]);
        close(fd_err[1]);
     }
+# endif
 }
 
     char *
index ce21ae7f41aba580c64f83ff227625eedbaf4b16..437e5f6cfd5e4da8054409a9777b661223e6de69 100644 (file)
@@ -743,6 +743,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1495,
 /**/
     1494,
 /**/