summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-22 18:39:00 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-22 18:39:00 +0200
commit61a6605ea1201eb49a126ca696fcfc56caf5dca6 (patch)
tree5b3aed6b0493301cfabfa088f59043d97081d6ed /src/os_unix.c
parent9f1f49b839fbc5d099301d5318a5e1e70dd59b7c (diff)
downloadvim-git-61a6605ea1201eb49a126ca696fcfc56caf5dca6.tar.gz
patch 8.0.0746: when :term fails the job is not properly cleaned upv8.0.0746
Problem: When :term fails the job is not properly cleaned up. Solution: Free the terminal. Handle a job that failed to start. (closes #1858)
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 156168fcc..bbc74c7f7 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5475,7 +5475,9 @@ mch_stop_job(job_T *job, char_u *how)
job_pid = -job_pid;
#endif
- kill(job_pid, sig);
+ /* Never kill ourselves! */
+ if (job_pid != 0)
+ kill(job_pid, sig);
return OK;
}