|
@ -62,15 +62,8 @@ exports.execFile = function (file /* args, options, callback */) { |
|
|
var stderr = ""; |
|
|
var stderr = ""; |
|
|
var killed = false; |
|
|
var killed = false; |
|
|
|
|
|
|
|
|
function kill(){ |
|
|
function kill () { |
|
|
if (killed) return; |
|
|
child.kill(options.killSignal); |
|
|
try { |
|
|
|
|
|
child.kill(options.killSignal); |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
if ("No such process" !== err.message) { |
|
|
|
|
|
throw err; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
killed = true; |
|
|
killed = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -167,10 +160,12 @@ util.inherits(ChildProcess, EventEmitter); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ChildProcess.prototype.kill = function (sig) { |
|
|
ChildProcess.prototype.kill = function (sig) { |
|
|
if (!constants) constants = process.binding("constants"); |
|
|
if (this._internal.pid) { |
|
|
sig = sig || 'SIGTERM'; |
|
|
if (!constants) constants = process.binding("constants"); |
|
|
if (!constants[sig]) throw new Error("Unknown signal: " + sig); |
|
|
sig = sig || 'SIGTERM'; |
|
|
return this._internal.kill(constants[sig]); |
|
|
if (!constants[sig]) throw new Error("Unknown signal: " + sig); |
|
|
|
|
|
return this._internal.kill(constants[sig]); |
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|