Skip to content

Commit

Permalink
tty: handle setRawMode errors
Browse files Browse the repository at this point in the history
PR-URL: #22886
Refs: #21773
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
seishun authored and danbev committed Sep 19, 2018
1 parent 28902f3 commit a82fc30
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ inherits(ReadStream, net.Socket);

ReadStream.prototype.setRawMode = function(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;
};

Expand Down

0 comments on commit a82fc30

Please sign in to comment.