|
@ -664,7 +664,7 @@ exports.execFile = function(file /* args, options, callback */) { |
|
|
var exited = false; |
|
|
var exited = false; |
|
|
var timeoutId; |
|
|
var timeoutId; |
|
|
|
|
|
|
|
|
var ex; |
|
|
var ex = null; |
|
|
|
|
|
|
|
|
function exithandler(code, signal) { |
|
|
function exithandler(code, signal) { |
|
|
if (exited) return; |
|
|
if (exited) return; |
|
@ -689,16 +689,25 @@ exports.execFile = function(file /* args, options, callback */) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (ex) { |
|
|
if (ex) { |
|
|
callback(ex, stdout, stderr); |
|
|
// Will be handled later
|
|
|
} else if (code === 0 && signal === null) { |
|
|
} else if (code === 0 && signal === null) { |
|
|
callback(null, stdout, stderr); |
|
|
callback(null, stdout, stderr); |
|
|
} else { |
|
|
return; |
|
|
ex = new Error('Command failed: ' + stderr); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var cmd = file; |
|
|
|
|
|
if (args.length !== 0) |
|
|
|
|
|
cmd += ' ' + args.join(' '); |
|
|
|
|
|
|
|
|
|
|
|
if (!ex) { |
|
|
|
|
|
ex = new Error('Command failed: ' + cmd + '\n' + stderr); |
|
|
ex.killed = child.killed || killed; |
|
|
ex.killed = child.killed || killed; |
|
|
ex.code = code < 0 ? uv.errname(code) : code; |
|
|
ex.code = code < 0 ? uv.errname(code) : code; |
|
|
ex.signal = signal; |
|
|
ex.signal = signal; |
|
|
callback(ex, stdout, stderr); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ex.cmd = cmd; |
|
|
|
|
|
callback(ex, stdout, stderr); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function errorhandler(e) { |
|
|
function errorhandler(e) { |
|
|