diff --git a/lib/child_process.js b/lib/child_process.js index fa6c1c7035c..34edbc25ad0 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -437,7 +437,8 @@ exports.fork = function(modulePath /*, args, options*/) { // Leave stdin open for the IPC channel. stdout and stderr should be the // same as the parent's if silent isn't set. - options.stdio = options.silent ? ['ipc', 'pipe', 'pipe'] : ['ipc', 1, 2]; + options.stdio = options.silent ? ['pipe', 'pipe', 'pipe', 'ipc'] : + [0, 1, 2, 'ipc']; return spawn(process.execPath, args, options); }; diff --git a/test/simple/test-child-process-fork3.js b/test/simple/test-child-process-fork3.js deleted file mode 100644 index a8a8985f058..00000000000 --- a/test/simple/test-child-process-fork3.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var common = require('../common'); -var assert = require('assert'); -var fork = require('child_process').fork; - -var filename = common.fixturesDir + '/destroy-stdin.js'; - -// Ensure that we don't accidentally close fd 0 and -// reuse it for something else, it causes all kinds -// of obscure bugs. -process.stdin.destroy(); -fork(filename).stdin.on('end', process.exit);