From 9ae1a612149c27d4ffc6e8e6561d4845ad786674 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sat, 21 Mar 2015 16:19:04 -0700 Subject: [PATCH] node: ensure that streams2 won't `.end()` stdin Stdin is purely read-only stream. Although, `net.Socket` might be used to create it if stdin is in fact a Pipe or TCP socket, the `stream.Duplex` should not try to call `.end()` on it. Fix: https://github.com/iojs/io.js/issues/1068 PR-URL: https://github.com/iojs/io.js/pull/1233 Reviewed-By: Chris Dickinson --- src/node.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/node.js b/src/node.js index 7215f747190a3c..dbadc6637307e4 100644 --- a/src/node.js +++ b/src/node.js @@ -630,6 +630,8 @@ writable: false }); } + // Make sure the stdin can't be `.end()`-ed + stdin._writableState.ended = true; break; default: