From c8fe8e8f5d37091ae078ea6dd5042229e77f2c05 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 17 Mar 2018 22:14:51 +0100 Subject: [PATCH] process: create stdin with `manualStart: true` Otherwise Node.js will try to read data from the handle. This causes issues when Node.js is already reading from the same handle, but a different associated stream (e.g. a possible IPC channel). PR-URL: https://github.com/nodejs/node/pull/19377 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell --- lib/internal/process/stdio.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/internal/process/stdio.js b/lib/internal/process/stdio.js index 75ede6a8e7e..9a16a5ab15f 100644 --- a/lib/internal/process/stdio.js +++ b/lib/internal/process/stdio.js @@ -77,13 +77,15 @@ function setupStdio() { stdin = new net.Socket({ handle: process.channel, readable: true, - writable: false + writable: false, + manualStart: true }); } else { stdin = new net.Socket({ fd: fd, readable: true, - writable: false + writable: false, + manualStart: true }); } // Make sure the stdin can't be `.end()`-ed