$OpenBSD: patch-src_nvim_os_process_c,v 1.1 2019/03/17 13:13:40 edd Exp $

Port job stopping bug fix to neovim:

Original vim fix:
https://github.com/vim/vim/commit/76ab4fd61901090e6af3451ca6c5ca0fc370571f#diff-b68adb4fa34020d8d7f0ab40a2704335

Index: src/nvim/os/process.c
--- src/nvim/os/process.c.orig
+++ src/nvim/os/process.c
@@ -89,21 +89,16 @@ bool os_proc_tree_kill(int pid, int sig)
 bool os_proc_tree_kill(int pid, int sig)
 {
   assert(sig == SIGTERM || sig == SIGKILL);
-  int pgid = getpgid(pid);
-  if (pgid > 0) {  // Ignore error. Never kill self (pid=0).
-    if (pgid == pid) {
-      ILOG("sending %s to process group: -%d",
-           sig == SIGTERM ? "SIGTERM" : "SIGKILL", pgid);
-      int rv = uv_kill(-pgid, sig);
-      return rv == 0;
-    } else {
-      // Should never happen, because process_spawn() did setsid() in the child.
-      ELOG("pgid %d != pid %d", pgid, pid);
-    }
+  if (pid != 0) {  // Never kill self (pid=0).
+    ILOG("sending %s to PIDs %d and %d",
+      sig == SIGTERM ? "SIGTERM" : "SIGKILL", -pid, pid);
+
+    int rv1 = uv_kill(-pid, sig);
+    int rv2 = uv_kill(pid, sig);
+    return (rv1 == 0) && (rv2 == 0);
   } else {
-    ELOG("getpgid(%d) returned %d", pid, pgid);
+    return false;
   }
-  return false;
 }
 #endif
 
