tty: handle setRawMode errors
PR-URL: https://github.com/nodejs/node/pull/22886 Refs: https://github.com/nodejs/node/issues/21773 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
28902f33aa
commit
a82fc30383
@ -68,7 +68,11 @@ inherits(ReadStream, net.Socket);
|
|||||||
|
|
||||||
ReadStream.prototype.setRawMode = function(flag) {
|
ReadStream.prototype.setRawMode = function(flag) {
|
||||||
flag = !!flag;
|
flag = !!flag;
|
||||||
this._handle.setRawMode(flag);
|
const err = this._handle.setRawMode(flag);
|
||||||
|
if (err) {
|
||||||
|
this.emit('error', errors.errnoException(err, 'setRawMode'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.isRaw = flag;
|
this.isRaw = flag;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user