mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.1.0572: stopping a job does not work properly on OpenBSD
Problem: Stopping a job does not work properly on OpenBSD. Solution: Do not use getpgid() to check the process group of the job processs ID, always pass the negative process ID to kill(). (George Koehler, closes #3656)
This commit is contained in:
parent
446e7a3cd3
commit
76ab4fd619
@ -5820,7 +5820,6 @@ mch_detect_ended_job(job_T *job_list)
|
|||||||
mch_signal_job(job_T *job, char_u *how)
|
mch_signal_job(job_T *job, char_u *how)
|
||||||
{
|
{
|
||||||
int sig = -1;
|
int sig = -1;
|
||||||
pid_t job_pid;
|
|
||||||
|
|
||||||
if (*how == NUL || STRCMP(how, "term") == 0)
|
if (*how == NUL || STRCMP(how, "term") == 0)
|
||||||
sig = SIGTERM;
|
sig = SIGTERM;
|
||||||
@ -5841,16 +5840,13 @@ mch_signal_job(job_T *job, char_u *how)
|
|||||||
else
|
else
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
|
||||||
/* TODO: have an option to only kill the process, not the group? */
|
// Never kill ourselves!
|
||||||
job_pid = job->jv_pid;
|
if (job->jv_pid != 0)
|
||||||
#ifdef HAVE_GETPGID
|
{
|
||||||
if (job_pid == getpgid(job_pid))
|
// TODO: have an option to only kill the process, not the group?
|
||||||
job_pid = -job_pid;
|
kill(-job->jv_pid, sig);
|
||||||
#endif
|
kill(job->jv_pid, sig);
|
||||||
|
}
|
||||||
/* Never kill ourselves! */
|
|
||||||
if (job_pid != 0)
|
|
||||||
kill(job_pid, sig);
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@ -792,6 +792,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 */
|
||||||
|
/**/
|
||||||
|
572,
|
||||||
/**/
|
/**/
|
||||||
571,
|
571,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user