summaryrefslogtreecommitdiff
path: root/lib/child_process.js
diff options
context:
space:
mode:
authorMicheil Smith <micheil@brandedcode.com>2012-03-05 17:53:15 +0000
committerisaacs <i@izs.me>2012-03-15 13:47:43 -0700
commit19fd5301bf45b7055d090b6132aef7c833f29248 (patch)
tree741ef9f5ac9eb4ebeb66900efb5f627664eb13fa /lib/child_process.js
parent96e3be3aa30069f61636840accbb6a60934b3f4c (diff)
downloadnode-new-19fd5301bf45b7055d090b6132aef7c833f29248.tar.gz
Expose original argv as process.execArgv for cluster and child_process.fork()
Diffstat (limited to 'lib/child_process.js')
-rw-r--r--lib/child_process.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/child_process.js b/lib/child_process.js
index c6a2a94bc5..3355b8ab28 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -165,7 +165,7 @@ function nop() { }
exports.fork = function(modulePath /*, args, options*/) {
// Get options and args arguments.
- var options, args;
+ var options, args, execArgv;
if (Array.isArray(arguments[1])) {
args = arguments[1];
options = arguments[2] || {};
@@ -174,9 +174,9 @@ exports.fork = function(modulePath /*, args, options*/) {
options = arguments[1] || {};
}
- // Copy args and add modulePath
- args = args.slice(0);
- args.unshift(modulePath);
+ // Prepare arguments for fork:
+ execArgv = options.execArgv || process.execArgv;
+ args = execArgv.concat([modulePath], args);
// Don't allow stdinStream and customFds since a stdin channel will be used
if (options.stdinStream) {