Skip to content

Commit 8c738fa

Browse files
committed
child_process.fork: don't overwrite env
thanks to Malte-Thorben Bruns for pointing this out
1 parent ca4a0fc commit 8c738fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/child_process_uv.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ exports.fork = function(modulePath, args, options) {
140140

141141
// Just need to set this - child process won't actually use the fd.
142142
// For backwards compat - this can be changed to 'NODE_CHANNEL' before v0.6.
143-
options.env = { NODE_CHANNEL_FD: 42 };
143+
if (!options.env) options.env = { };
144+
options.env.NODE_CHANNEL_FD = 42;
144145

145146
// stdin is the IPC channel.
146147
options.stdinStream = createPipe(true);

0 commit comments

Comments
 (0)