]> granicus.if.org Git - vim/commitdiff
patch 8.1.0572: stopping a job does not work properly on OpenBSD v8.1.0572
authorBram Moolenaar <Bram@vim.org>
Sat, 8 Dec 2018 13:39:05 +0000 (14:39 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 8 Dec 2018 13:39:05 +0000 (14:39 +0100)
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)

src/os_unix.c
src/version.c

index 4d902d93950f30b8a802be9604c24e29ae82b63a..ecb348c4dcda87f20205d5133ce8b303806abc2a 100644 (file)
@@ -5820,7 +5820,6 @@ mch_detect_ended_job(job_T *job_list)
 mch_signal_job(job_T *job, char_u *how)
 {
     int            sig = -1;
-    pid_t   job_pid;
 
     if (*how == NUL || STRCMP(how, "term") == 0)
        sig = SIGTERM;
@@ -5841,16 +5840,13 @@ mch_signal_job(job_T *job, char_u *how)
     else
        return FAIL;
 
-    /* TODO: have an option to only kill the process, not the group? */
-    job_pid = job->jv_pid;
-#ifdef HAVE_GETPGID
-    if (job_pid == getpgid(job_pid))
-       job_pid = -job_pid;
-#endif
-
-    /* Never kill ourselves! */
-    if (job_pid != 0)
-       kill(job_pid, sig);
+    // Never kill ourselves!
+    if (job->jv_pid != 0)
+    {
+       // TODO: have an option to only kill the process, not the group?
+       kill(-job->jv_pid, sig);
+       kill(job->jv_pid, sig);
+    }
 
     return OK;
 }
index 049f34b8125a3dd6c928e0118ab1bc33febc9eec..9311bc50aa9b018a550515bcc0c768edbe126456 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    572,
 /**/
     571,
 /**/