mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.1328
Problem: Can't compile with +job but without +channel. (John Marriott) Solution: Add more #ifdefs.
This commit is contained in:
parent
b6a7737938
commit
12dcf024e9
@ -5043,7 +5043,9 @@ mch_start_job(char **argv, job_T *job)
|
|||||||
int fd_in[2]; /* for stdin */
|
int fd_in[2]; /* for stdin */
|
||||||
int fd_out[2]; /* for stdout */
|
int fd_out[2]; /* for stdout */
|
||||||
int fd_err[2]; /* for stderr */
|
int fd_err[2]; /* for stderr */
|
||||||
|
# ifdef FEAT_CHANNEL
|
||||||
channel_T *channel = NULL;
|
channel_T *channel = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* default is to fail */
|
/* default is to fail */
|
||||||
job->jv_status = JOB_FAILED;
|
job->jv_status = JOB_FAILED;
|
||||||
@ -5051,6 +5053,8 @@ mch_start_job(char **argv, job_T *job)
|
|||||||
fd_out[0] = -1;
|
fd_out[0] = -1;
|
||||||
fd_err[0] = -1;
|
fd_err[0] = -1;
|
||||||
|
|
||||||
|
/* TODO: without the channel feature connect the child to /dev/null? */
|
||||||
|
# ifdef FEAT_CHANNEL
|
||||||
/* Open pipes for stdin, stdout, stderr. */
|
/* Open pipes for stdin, stdout, stderr. */
|
||||||
if ((pipe(fd_in) < 0) || (pipe(fd_out) < 0) ||(pipe(fd_err) < 0))
|
if ((pipe(fd_in) < 0) || (pipe(fd_out) < 0) ||(pipe(fd_err) < 0))
|
||||||
goto failed;
|
goto failed;
|
||||||
@ -5058,6 +5062,7 @@ mch_start_job(char **argv, job_T *job)
|
|||||||
channel = add_channel();
|
channel = add_channel();
|
||||||
if (channel == NULL)
|
if (channel == NULL)
|
||||||
goto failed;
|
goto failed;
|
||||||
|
# endif
|
||||||
|
|
||||||
pid = fork(); /* maybe we should use vfork() */
|
pid = fork(); /* maybe we should use vfork() */
|
||||||
if (pid == -1)
|
if (pid == -1)
|
||||||
@ -5080,6 +5085,8 @@ mch_start_job(char **argv, job_T *job)
|
|||||||
|
|
||||||
set_child_environment();
|
set_child_environment();
|
||||||
|
|
||||||
|
/* TODO: re-enable this when pipes connect without a channel */
|
||||||
|
# ifdef FEAT_CHANNEL
|
||||||
/* set up stdin for the child */
|
/* set up stdin for the child */
|
||||||
close(fd_in[1]);
|
close(fd_in[1]);
|
||||||
close(0);
|
close(0);
|
||||||
@ -5097,6 +5104,7 @@ mch_start_job(char **argv, job_T *job)
|
|||||||
close(2);
|
close(2);
|
||||||
ignored = dup(fd_err[1]);
|
ignored = dup(fd_err[1]);
|
||||||
close(fd_err[1]);
|
close(fd_err[1]);
|
||||||
|
# endif
|
||||||
|
|
||||||
/* See above for type of argv. */
|
/* See above for type of argv. */
|
||||||
execvp(argv[0], argv);
|
execvp(argv[0], argv);
|
||||||
@ -5108,23 +5116,29 @@ mch_start_job(char **argv, job_T *job)
|
|||||||
/* parent */
|
/* parent */
|
||||||
job->jv_pid = pid;
|
job->jv_pid = pid;
|
||||||
job->jv_status = JOB_STARTED;
|
job->jv_status = JOB_STARTED;
|
||||||
|
# ifdef FEAT_CHANNEL
|
||||||
job->jv_channel = channel;
|
job->jv_channel = channel;
|
||||||
|
# endif
|
||||||
|
|
||||||
/* child stdin, stdout and stderr */
|
/* child stdin, stdout and stderr */
|
||||||
close(fd_in[0]);
|
close(fd_in[0]);
|
||||||
close(fd_out[1]);
|
close(fd_out[1]);
|
||||||
close(fd_err[1]);
|
close(fd_err[1]);
|
||||||
|
# ifdef FEAT_CHANNEL
|
||||||
channel_set_pipes(channel, fd_in[1], fd_out[0], fd_err[0]);
|
channel_set_pipes(channel, fd_in[1], fd_out[0], fd_err[0]);
|
||||||
channel_set_job(channel, job);
|
channel_set_job(channel, job);
|
||||||
#ifdef FEAT_GUI
|
# ifdef FEAT_GUI
|
||||||
channel_gui_register(channel);
|
channel_gui_register(channel);
|
||||||
#endif
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
|
# ifdef FEAT_CHANNEL
|
||||||
if (channel != NULL)
|
if (channel != NULL)
|
||||||
channel_free(channel);
|
channel_free(channel);
|
||||||
|
# endif
|
||||||
if (fd_in[0] >= 0)
|
if (fd_in[0] >= 0)
|
||||||
{
|
{
|
||||||
close(fd_in[0]);
|
close(fd_in[0]);
|
||||||
|
@ -747,6 +747,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1328,
|
||||||
/**/
|
/**/
|
||||||
1327,
|
1327,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user