Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
fork: don't clear environment by default
Browse files Browse the repository at this point in the history
- Set options.env to process.env instead of {} by default.
- Shallow clone the passed options.env in case the user passed process.env directly.
  • Loading branch information
shlevy authored and piscisaureus committed Mar 7, 2012
1 parent c84b3c4 commit 024451c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/child_process.js
Expand Up @@ -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.
Expand Down

0 comments on commit 024451c

Please sign in to comment.