Skip to content

Commit 802d559

Browse files
committed
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)
1 parent 119d469 commit 802d559

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/os_unix.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5037,16 +5037,15 @@ mch_call_shell(
50375037

50385038
#if defined(FEAT_JOB) || defined(PROTO)
50395039
void
5040-
mch_start_job(char **argv, job_T *job, jobopt_T *options)
5040+
mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED)
50415041
{
50425042
pid_t pid;
5043+
# ifdef FEAT_CHANNEL
50435044
int fd_in[2]; /* for stdin */
50445045
int fd_out[2]; /* for stdout */
50455046
int fd_err[2]; /* for stderr */
5046-
# ifdef FEAT_CHANNEL
50475047
channel_T *channel = NULL;
50485048
int use_out_for_err = options->jo_io[PART_ERR] == JIO_OUT;
5049-
#endif
50505049

50515050
/* default is to fail */
50525051
job->jv_status = JOB_FAILED;
@@ -5055,7 +5054,6 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options)
50555054
fd_err[0] = -1;
50565055

50575056
/* TODO: without the channel feature connect the child to /dev/null? */
5058-
# ifdef FEAT_CHANNEL
50595057
/* Open pipes for stdin, stdout, stderr. */
50605058
if (pipe(fd_in) < 0 || pipe(fd_out) < 0
50615059
|| (!use_out_for_err && pipe(fd_err) < 0))
@@ -5114,7 +5112,6 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options)
51145112
close(1);
51155113
ignored = dup(fd_out[1]);
51165114
close(fd_out[1]);
5117-
51185115
# endif
51195116

51205117
/* See above for type of argv. */
@@ -5131,14 +5128,12 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options)
51315128
job->jv_channel = channel;
51325129
# endif
51335130

5131+
# ifdef FEAT_CHANNEL
51345132
/* child stdin, stdout and stderr */
51355133
close(fd_in[0]);
51365134
close(fd_out[1]);
5137-
# ifdef FEAT_CHANNEL
51385135
if (!use_out_for_err)
5139-
# endif
51405136
close(fd_err[1]);
5141-
# ifdef FEAT_CHANNEL
51425137
channel_set_pipes(channel, fd_in[1], fd_out[0],
51435138
use_out_for_err ? INVALID_FD : fd_err[0]);
51445139
channel_set_job(channel, job, options);
@@ -5149,11 +5144,10 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options)
51495144

51505145
return;
51515146

5152-
failed:
5147+
failed: ;
51535148
# ifdef FEAT_CHANNEL
51545149
if (channel != NULL)
51555150
channel_free(channel);
5156-
# endif
51575151
if (fd_in[0] >= 0)
51585152
{
51595153
close(fd_in[0]);
@@ -5169,6 +5163,7 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options)
51695163
close(fd_err[0]);
51705164
close(fd_err[1]);
51715165
}
5166+
# endif
51725167
}
51735168

51745169
char *

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1495,
746748
/**/
747749
1494,
748750
/**/

0 commit comments

Comments
 (0)