Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 024451c65cf0a1da4da48f99885cb8e7c2d20c72 1 parent c84b3c4
Shea Levy shlevy authored piscisaureus committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/child_process.js
2  lib/child_process.js
View
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.