|
|
@ -25,6 +25,7 @@ exports.execFile = function(file /* args, options, callback */) { |
|
|
|
timeout: 0, |
|
|
|
maxBuffer: 200 * 1024, |
|
|
|
killSignal: 'SIGTERM', |
|
|
|
setsid: false, |
|
|
|
cwd: null, |
|
|
|
env: null }; |
|
|
|
var args, optionArg, callback; |
|
|
@ -184,7 +185,7 @@ ChildProcess.prototype.kill = function(sig) { |
|
|
|
ChildProcess.prototype.spawn = function(path, args, options, customFds) { |
|
|
|
args = args || []; |
|
|
|
|
|
|
|
var cwd, env; |
|
|
|
var cwd, env, setuid; |
|
|
|
if (!options || options.cwd === undefined && |
|
|
|
options.env === undefined && |
|
|
|
options.customFds === undefined) { |
|
|
@ -192,11 +193,13 @@ ChildProcess.prototype.spawn = function(path, args, options, customFds) { |
|
|
|
cwd = ''; |
|
|
|
env = options || process.env; |
|
|
|
customFds = customFds || [-1, -1, -1]; |
|
|
|
setuid = false; |
|
|
|
} else { |
|
|
|
// Recommended API: (path, args, options)
|
|
|
|
cwd = options.cwd || ''; |
|
|
|
env = options.env || process.env; |
|
|
|
customFds = options.customFds || [-1, -1, -1]; |
|
|
|
setuid = options.setuid ? true : false; |
|
|
|
} |
|
|
|
|
|
|
|
var envPairs = []; |
|
|
@ -206,7 +209,12 @@ ChildProcess.prototype.spawn = function(path, args, options, customFds) { |
|
|
|
envPairs.push(key + '=' + env[key]); |
|
|
|
} |
|
|
|
|
|
|
|
var fds = this._internal.spawn(path, args, cwd, envPairs, customFds); |
|
|
|
var fds = this._internal.spawn(path, |
|
|
|
args, |
|
|
|
cwd, |
|
|
|
envPairs, |
|
|
|
customFds, |
|
|
|
setuid); |
|
|
|
this.fds = fds; |
|
|
|
|
|
|
|
if (customFds[0] === -1 || customFds[0] === undefined) { |
|
|
|