Mercurial > vim
comparison src/os_win32.c @ 8251:989ac3aed1ef v7.4.1418
commit https://github.com/vim/vim/commit/923d926d57d985ec8965da9d0cd3634e6b24bfe1
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 25 20:56:01 2016 +0100
patch 7.4.1418
Problem: job_stop() on MS-Windows does not really stop the job.
Solution: Make the default to stop the job forcefully. (Ken Takata)
Make MS-Windows and Unix more similar.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 25 Feb 2016 21:00:04 +0100 |
parents | 4f0677020a43 |
children | 74b15ed0a259 |
comparison
equal
deleted
inserted
replaced
8250:271c3532857a | 8251:989ac3aed1ef |
---|---|
5139 } | 5139 } |
5140 | 5140 |
5141 int | 5141 int |
5142 mch_stop_job(job_T *job, char_u *how) | 5142 mch_stop_job(job_T *job, char_u *how) |
5143 { | 5143 { |
5144 int ret = 0; | 5144 int ret; |
5145 int ctrl_c = STRCMP(how, "int") == 0; | 5145 |
5146 | 5146 if (STRCMP(how, "term") == 0 || STRCMP(how, "kill") == 0 || *how == NUL) |
5147 if (STRCMP(how, "kill") == 0) | |
5148 { | 5147 { |
5149 if (job->jv_job_object != NULL) | 5148 if (job->jv_job_object != NULL) |
5150 return TerminateJobObject(job->jv_job_object, 0) ? OK : FAIL; | 5149 return TerminateJobObject(job->jv_job_object, 0) ? OK : FAIL; |
5151 else | 5150 else |
5152 return TerminateProcess(job->jv_proc_info.hProcess, 0) ? OK : FAIL; | 5151 return TerminateProcess(job->jv_proc_info.hProcess, 0) ? OK : FAIL; |
5153 } | 5152 } |
5154 | 5153 |
5155 if (!AttachConsole(job->jv_proc_info.dwProcessId)) | 5154 if (!AttachConsole(job->jv_proc_info.dwProcessId)) |
5156 return FAIL; | 5155 return FAIL; |
5157 ret = GenerateConsoleCtrlEvent( | 5156 ret = GenerateConsoleCtrlEvent( |
5158 ctrl_c ? CTRL_C_EVENT : CTRL_BREAK_EVENT, | 5157 STRCMP(how, "int") == 0 ? CTRL_C_EVENT : CTRL_BREAK_EVENT, |
5159 job->jv_proc_info.dwProcessId) | 5158 job->jv_proc_info.dwProcessId) |
5160 ? OK : FAIL; | 5159 ? OK : FAIL; |
5161 FreeConsole(); | 5160 FreeConsole(); |
5162 return ret; | 5161 return ret; |
5163 } | 5162 } |
5164 | 5163 |
5165 /* | 5164 /* |