Skip to content

Commit

Permalink
- spawn a child process to kill a pid on Windows (#2182 #1749)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud committed Jul 11, 2016
1 parent 2ba399b commit f802de4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/TreeKill.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
*
*/

var cst = require('../constants.js');
var exec = require('child_process').exec,
isWin = (process.platform === 'win32' || process.platform === 'win64'),
downgradePs = false;

module.exports = function(pid, signal){
if (isWin) {
exec('taskkill /pid ' + pid + ' /T /F');
if (cst.IS_WINDOWS) {
require('child_process').spawn('taskkill', ['/pid', pid,'/T', '/F'], {
detached: true
});
} else {
var tree = {}, pidsToProcess = {};
buildProcessTree(pid, tree, pidsToProcess, function(){
Expand Down

0 comments on commit f802de4

Please sign in to comment.