Skip to content

Commit 12dcf02

Browse files
committed
patch 7.4.1328
Problem: Can't compile with +job but without +channel. (John Marriott) Solution: Add more #ifdefs.
1 parent b6a7737 commit 12dcf02

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/os_unix.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5043,21 +5043,26 @@ mch_start_job(char **argv, job_T *job)
50435043
int fd_in[2]; /* for stdin */
50445044
int fd_out[2]; /* for stdout */
50455045
int fd_err[2]; /* for stderr */
5046+
# ifdef FEAT_CHANNEL
50465047
channel_T *channel = NULL;
5048+
#endif
50475049

50485050
/* default is to fail */
50495051
job->jv_status = JOB_FAILED;
50505052
fd_in[0] = -1;
50515053
fd_out[0] = -1;
50525054
fd_err[0] = -1;
50535055

5056+
/* TODO: without the channel feature connect the child to /dev/null? */
5057+
# ifdef FEAT_CHANNEL
50545058
/* Open pipes for stdin, stdout, stderr. */
50555059
if ((pipe(fd_in) < 0) || (pipe(fd_out) < 0) ||(pipe(fd_err) < 0))
50565060
goto failed;
50575061

50585062
channel = add_channel();
50595063
if (channel == NULL)
50605064
goto failed;
5065+
# endif
50615066

50625067
pid = fork(); /* maybe we should use vfork() */
50635068
if (pid == -1)
@@ -5080,6 +5085,8 @@ mch_start_job(char **argv, job_T *job)
50805085

50815086
set_child_environment();
50825087

5088+
/* TODO: re-enable this when pipes connect without a channel */
5089+
# ifdef FEAT_CHANNEL
50835090
/* set up stdin for the child */
50845091
close(fd_in[1]);
50855092
close(0);
@@ -5097,6 +5104,7 @@ mch_start_job(char **argv, job_T *job)
50975104
close(2);
50985105
ignored = dup(fd_err[1]);
50995106
close(fd_err[1]);
5107+
# endif
51005108

51015109
/* See above for type of argv. */
51025110
execvp(argv[0], argv);
@@ -5108,23 +5116,29 @@ mch_start_job(char **argv, job_T *job)
51085116
/* parent */
51095117
job->jv_pid = pid;
51105118
job->jv_status = JOB_STARTED;
5119+
# ifdef FEAT_CHANNEL
51115120
job->jv_channel = channel;
5121+
# endif
51125122

51135123
/* child stdin, stdout and stderr */
51145124
close(fd_in[0]);
51155125
close(fd_out[1]);
51165126
close(fd_err[1]);
5127+
# ifdef FEAT_CHANNEL
51175128
channel_set_pipes(channel, fd_in[1], fd_out[0], fd_err[0]);
51185129
channel_set_job(channel, job);
5119-
#ifdef FEAT_GUI
5130+
# ifdef FEAT_GUI
51205131
channel_gui_register(channel);
5121-
#endif
5132+
# endif
5133+
# endif
51225134

51235135
return;
51245136

51255137
failed:
5138+
# ifdef FEAT_CHANNEL
51265139
if (channel != NULL)
51275140
channel_free(channel);
5141+
# endif
51285142
if (fd_in[0] >= 0)
51295143
{
51305144
close(fd_in[0]);

src/version.c

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

748748
static int included_patches[] =
749749
{ /* Add new patch number below this line */
750+
/**/
751+
1328,
750752
/**/
751753
1327,
752754
/**/

0 commit comments

Comments
 (0)