fork: don't clear environment by default
- Set options.env to process.env instead of {} by default. - Shallow clone the passed options.env in case the user passed process.env directly.
This commit is contained in:
parent
c84b3c4b73
commit
024451c65c
@ -193,7 +193,7 @@ exports.fork = function(modulePath /*, args, options*/) {
|
||||
|
||||
// Just need to set this - child process won't actually use the fd.
|
||||
// For backwards compat - this can be changed to 'NODE_CHANNEL' before v0.6.
|
||||
if (!options.env) options.env = { };
|
||||
options.env = util._extend({}, options.env || process.env);
|
||||
options.env.NODE_CHANNEL_FD = 42;
|
||||
|
||||
// stdin is the IPC channel.
|
||||
|
Loading…
x
Reference in New Issue
Block a user