To: vim_dev@googlegroups.com Subject: Patch 7.4.1495 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1495 Problem: Compiler warnings when building on Unix with the job feature but without the channel feature. Solution: Move #ifdefs. (Dominique Pelle) Files: src/os_unxi.c *** ../vim-7.4.1494/src/os_unix.c 2016-03-03 22:51:36.133809707 +0100 --- src/os_unix.c 2016-03-05 21:36:12.686195373 +0100 *************** *** 5037,5052 **** #if defined(FEAT_JOB) || defined(PROTO) void ! mch_start_job(char **argv, job_T *job, jobopt_T *options) { pid_t pid; 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; --- 5037,5051 ---- #if defined(FEAT_JOB) || defined(PROTO) void ! 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 */ channel_T *channel = NULL; int use_out_for_err = options->jo_io[PART_ERR] == JIO_OUT; /* default is to fail */ job->jv_status = JOB_FAILED; *************** *** 5055,5061 **** 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)) --- 5054,5059 ---- *************** *** 5114,5120 **** close(1); ignored = dup(fd_out[1]); close(fd_out[1]); - # endif /* See above for type of argv. */ --- 5112,5117 ---- *************** *** 5131,5144 **** job->jv_channel = channel; # endif /* 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); --- 5128,5139 ---- job->jv_channel = channel; # endif + # ifdef FEAT_CHANNEL /* child stdin, stdout and stderr */ close(fd_in[0]); close(fd_out[1]); if (!use_out_for_err) close(fd_err[1]); 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,5159 **** return; ! failed: # ifdef FEAT_CHANNEL if (channel != NULL) channel_free(channel); - # endif if (fd_in[0] >= 0) { close(fd_in[0]); --- 5144,5153 ---- return; ! failed: ; # ifdef FEAT_CHANNEL if (channel != NULL) channel_free(channel); if (fd_in[0] >= 0) { close(fd_in[0]); *************** *** 5169,5174 **** --- 5163,5169 ---- close(fd_err[0]); close(fd_err[1]); } + # endif } char * *** ../vim-7.4.1494/src/version.c 2016-03-05 21:21:09.091720206 +0100 --- src/version.c 2016-03-05 21:37:12.941559811 +0100 *************** *** 745,746 **** --- 745,748 ---- { /* Add new patch number below this line */ + /**/ + 1495, /**/ -- I recommend ordering large cargo containers of paper towels to make up whatever budget underruns you have. Paper products are always useful and they have the advantage of being completely flushable if you need to make room in the storage area later. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///