Revert "tty: don't read from console stream upon creation"
This reverts commit 461138929498f31bd35bea61aa4375a2f56cceb7. The offending commit broke certain usages of piping from stdin. Fixes: https://github.com/nodejs/node/issues/5927 PR-URL: https://github.com/nodejs/node/pull/5947 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Alexis Campailla <orangemocha@nodejs.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
89abe86808
commit
b6475b9a9d
@ -17,23 +17,17 @@ function ReadStream(fd, options) {
|
|||||||
if (!(this instanceof ReadStream))
|
if (!(this instanceof ReadStream))
|
||||||
return new ReadStream(fd, options);
|
return new ReadStream(fd, options);
|
||||||
|
|
||||||
// pauseOnCreate to avoid reading from the sytem buffer
|
|
||||||
options = util._extend({
|
options = util._extend({
|
||||||
highWaterMark: 0,
|
highWaterMark: 0,
|
||||||
readable: true,
|
readable: true,
|
||||||
writable: false,
|
writable: false,
|
||||||
handle: new TTY(fd, true),
|
handle: new TTY(fd, true)
|
||||||
pauseOnCreate: true
|
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
net.Socket.call(this, options);
|
net.Socket.call(this, options);
|
||||||
|
|
||||||
this.isRaw = false;
|
this.isRaw = false;
|
||||||
this.isTTY = true;
|
this.isTTY = true;
|
||||||
|
|
||||||
// Let the stream resume automatically when 'data' event handlers
|
|
||||||
// are added, even though it was paused on creation
|
|
||||||
this._readableState.flowing = null;
|
|
||||||
}
|
}
|
||||||
inherits(ReadStream, net.Socket);
|
inherits(ReadStream, net.Socket);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user