To: vim_dev@googlegroups.com Subject: Patch 8.2.0238 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0238 Problem: MS-Windows: job_stop() results in exit value zero. Solution: Call TerminateJobObject() with -1 instead of 0. (Yasuhiro Matsumoto, closes #5150, closes #5614) Files: src/os_win32.c, src/testdir/test_channel.vim *** ../vim-8.2.0237/src/os_win32.c 2020-01-30 11:53:55.950449934 +0100 --- src/os_win32.c 2020-02-10 21:29:09.530184370 +0100 *************** *** 5384,5392 **** { if (job->jv_channel != NULL && job->jv_channel->ch_anonymous_pipe) job->jv_channel->ch_killing = TRUE; ! return TerminateJobObject(job->jv_job_object, 0) ? OK : FAIL; } ! return terminate_all(job->jv_proc_info.hProcess, 0) ? OK : FAIL; } if (!AttachConsole(job->jv_proc_info.dwProcessId)) --- 5384,5392 ---- { if (job->jv_channel != NULL && job->jv_channel->ch_anonymous_pipe) job->jv_channel->ch_killing = TRUE; ! return TerminateJobObject(job->jv_job_object, -1) ? OK : FAIL; } ! return terminate_all(job->jv_proc_info.hProcess, -1) ? OK : FAIL; } if (!AttachConsole(job->jv_proc_info.dwProcessId)) *** ../vim-8.2.0237/src/testdir/test_channel.vim 2020-01-30 18:24:46.997204019 +0100 --- src/testdir/test_channel.vim 2020-02-10 21:29:09.530184370 +0100 *************** *** 1991,1993 **** --- 1991,2008 ---- " this was leaking memory call assert_fails("call job_start([''])", "E474:") endfunc + + func Test_issue_5150() + let g:job = job_start('grep foo', {}) + call job_stop(g:job) + sleep 10m + call assert_equal(-1, job_info(g:job).exitval) + let g:job = job_start('grep foo', {}) + call job_stop(g:job, 'term') + sleep 10m + call assert_equal(-1, job_info(g:job).exitval) + let g:job = job_start('grep foo', {}) + call job_stop(g:job, 'kill') + sleep 10m + call assert_equal(-1, job_info(g:job).exitval) + endfunc *** ../vim-8.2.0237/src/version.c 2020-02-10 20:33:44.113043189 +0100 --- src/version.c 2020-02-10 21:31:57.893531263 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 238, /**/ -- hundred-and-one symptoms of being an internet addict: 51. You put a pillow case over your laptop so your lover doesn't see it while you are pretending to catch your breath. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///