-
-
Save mmalecki/6695c76213a1ca56bbb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/child_process.js b/lib/child_process.js | |
index b3e6383..6898a99 100644 | |
--- a/lib/child_process.js | |
+++ b/lib/child_process.js | |
@@ -167,10 +167,6 @@ exports.fork = function(modulePath, args, options) { | |
throw new Error('customFds not allowed for fork()'); | |
} | |
- // Leave stdin open for the IPC channel. stdout and stderr should be the | |
- // same as the parent's if silent isn't set. | |
- options.customFds = (options.silent ? [-1, -1, -1] : [-1, 1, 2]); | |
- | |
// 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 = { }; | |
@@ -181,6 +177,11 @@ exports.fork = function(modulePath, args, options) { | |
var child = spawn(process.execPath, args, options); | |
+ if (!options.silent) { | |
+ child.stdout.pipe(process.stdout, { end: false }); | |
+ child.stderr.pipe(process.stderr, { end: false }); | |
+ } | |
+ | |
setupChannel(child, options.stdinStream); | |
child.on('exit', function() { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment