summaryrefslogtreecommitdiff
path: root/lib/tty.js
diff options
context:
space:
mode:
authorNikolai Vavilov <vvnicholas@gmail.com>2018-09-16 22:47:17 +0300
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-09-19 14:05:19 +0200
commita82fc30383b51940cc84823cad6284ef61a7927a (patch)
tree3a702effbea1a1cae777800f899c412f4e6c7cee /lib/tty.js
parent28902f33aa916e12b094431a56e825ba649edbc4 (diff)
downloadandroid-node-v8-a82fc30383b51940cc84823cad6284ef61a7927a.tar.gz
android-node-v8-a82fc30383b51940cc84823cad6284ef61a7927a.tar.bz2
android-node-v8-a82fc30383b51940cc84823cad6284ef61a7927a.zip
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>
Diffstat (limited to 'lib/tty.js')
-rw-r--r--lib/tty.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/tty.js b/lib/tty.js
index 62eb8719b1..4e78347c2d 100644
--- a/lib/tty.js
+++ b/lib/tty.js
@@ -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;
};