diff options
author | isaacs <i@izs.me> | 2012-12-21 02:08:40 +0000 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-12-21 11:05:46 -0800 |
commit | 244924823ec0db092a39044408a1adb6e48cf3c3 (patch) | |
tree | 94154f1ed82dac3e3bd2a776a9c959b9fae4e89a /src/node.js | |
parent | 0edd93dcc1e0083511fc82fd5c44e96949200a4b (diff) | |
download | node-new-244924823ec0db092a39044408a1adb6e48cf3c3.tar.gz |
stdio: Do not read from stdout/err
This fixes windows stdio pipes in streams2 land.
Diffstat (limited to 'src/node.js')
-rw-r--r-- | src/node.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/node.js b/src/node.js index 76c94b7592..6cce75f68e 100644 --- a/src/node.js +++ b/src/node.js @@ -430,13 +430,18 @@ case 'PIPE': var net = NativeModule.require('net'); - stream = new net.Stream(fd); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); - // FIXME Should probably have an option in net.Stream to create a + // FIXME Should probably have an option in net.Socket to create a // stream from an existing fd which is writable only. But for now // we'll just add this hack and set the `readable` member to false. // Test: ./node test/fixtures/echo.js < /etc/passwd stream.readable = false; + stream.read = null; stream._type = 'pipe'; // FIXME Hack to have stream not keep the event loop alive. @@ -498,7 +503,9 @@ var tty = NativeModule.require('tty'); stdin = new tty.ReadStream(fd, { highWaterMark: 0, - lowWaterMark: 0 + lowWaterMark: 0, + readable: true, + writable: false }); break; @@ -509,8 +516,11 @@ case 'PIPE': var net = NativeModule.require('net'); - stdin = new net.Stream({ fd: fd }); - stdin.readable = true; + stdin = new net.Socket({ + fd: fd, + readable: true, + writable: false + }); break; default: |