From 8c738fa90c137932eb276cef3e48fadf6e56b234 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 10 Oct 2011 14:49:02 -0700 Subject: [PATCH] child_process.fork: don't overwrite env thanks to Malte-Thorben Bruns for pointing this out --- lib/child_process_uv.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/child_process_uv.js b/lib/child_process_uv.js index da712a4d31..f2a1a7fdd1 100644 --- a/lib/child_process_uv.js +++ b/lib/child_process_uv.js @@ -140,7 +140,8 @@ 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. - options.env = { NODE_CHANNEL_FD: 42 }; + if (!options.env) options.env = { }; + options.env.NODE_CHANNEL_FD = 42; // stdin is the IPC channel. options.stdinStream = createPipe(true);