mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0071
Problem: Exit value from a shell command is wrong. (Hexchain Tong) Solution: Do not check for ended jobs while waiting for a shell command. (ichizok, closes #1196)
This commit is contained in:
@@ -238,6 +238,10 @@ static volatile int deadly_signal = 0; /* The signal we caught */
|
|||||||
/* volatile because it is used in signal handler deathtrap(). */
|
/* volatile because it is used in signal handler deathtrap(). */
|
||||||
static volatile int in_mch_delay = FALSE; /* sleeping in mch_delay() */
|
static volatile int in_mch_delay = FALSE; /* sleeping in mch_delay() */
|
||||||
|
|
||||||
|
#if defined(FEAT_JOB_CHANNEL) && !defined(USE_SYSTEM)
|
||||||
|
static int dont_check_job_ended = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
static int curr_tmode = TMODE_COOK; /* contains current terminal mode */
|
static int curr_tmode = TMODE_COOK; /* contains current terminal mode */
|
||||||
|
|
||||||
#ifdef USE_XSMP
|
#ifdef USE_XSMP
|
||||||
@@ -4485,7 +4489,9 @@ mch_call_shell(
|
|||||||
catch_signals(SIG_IGN, SIG_ERR);
|
catch_signals(SIG_IGN, SIG_ERR);
|
||||||
catch_int_signal();
|
catch_int_signal();
|
||||||
UNBLOCK_SIGNALS(&curset);
|
UNBLOCK_SIGNALS(&curset);
|
||||||
|
# ifdef FEAT_JOB_CHANNEL
|
||||||
|
++dont_check_job_ended;
|
||||||
|
# endif
|
||||||
/*
|
/*
|
||||||
* For the GUI we redirect stdin, stdout and stderr to our window.
|
* For the GUI we redirect stdin, stdout and stderr to our window.
|
||||||
* This is also used to pipe stdin/stdout to/from the external
|
* This is also used to pipe stdin/stdout to/from the external
|
||||||
@@ -5030,6 +5036,10 @@ finished:
|
|||||||
wait4pid(wpid, NULL);
|
wait4pid(wpid, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef FEAT_JOB_CHANNEL
|
||||||
|
--dont_check_job_ended;
|
||||||
|
# endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set to raw mode right now, otherwise a CTRL-C after
|
* Set to raw mode right now, otherwise a CTRL-C after
|
||||||
* catch_signals() will kill Vim.
|
* catch_signals() will kill Vim.
|
||||||
@@ -5363,6 +5373,14 @@ mch_detect_ended_job(job_T *job_list)
|
|||||||
pid_t wait_pid = 0;
|
pid_t wait_pid = 0;
|
||||||
job_T *job;
|
job_T *job;
|
||||||
|
|
||||||
|
# ifndef USE_SYSTEM
|
||||||
|
/* Do not do this when waiting for a shell command to finish, we would get
|
||||||
|
* the exit value here (and discard it), the exit value obtained there
|
||||||
|
* would then be wrong. */
|
||||||
|
if (dont_check_job_ended > 0)
|
||||||
|
return NULL;
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef __NeXT__
|
# ifdef __NeXT__
|
||||||
wait_pid = wait4(-1, &status, WNOHANG, (struct rusage *)0);
|
wait_pid = wait4(-1, &status, WNOHANG, (struct rusage *)0);
|
||||||
# else
|
# else
|
||||||
|
@@ -764,6 +764,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 */
|
||||||
|
/**/
|
||||||
|
71,
|
||||||
/**/
|
/**/
|
||||||
70,
|
70,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user