summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2015-03-21 16:19:04 -0700
committerFedor Indutny <fedor@indutny.com>2015-03-21 19:51:08 -0700
commit9ae1a612149c27d4ffc6e8e6561d4845ad786674 (patch)
treec40e53159a170ac523e8295dcdbc2d26e418dfa6
parent999fbe9d96cbdff9cd69f0d23c6671dc0d7f3e9e (diff)
downloadandroid-node-v8-9ae1a612149c27d4ffc6e8e6561d4845ad786674.tar.gz
android-node-v8-9ae1a612149c27d4ffc6e8e6561d4845ad786674.tar.bz2
android-node-v8-9ae1a612149c27d4ffc6e8e6561d4845ad786674.zip
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 <christopher.s.dickinson@gmail.com>
-rw-r--r--src/node.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node.js b/src/node.js
index 7215f74719..dbadc66373 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: