summaryrefslogtreecommitdiff
path: root/lib/tty.js
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-07-18 23:18:50 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-07-20 12:09:29 +0200
commitca9eb718fbf2cd2c60c7aeb3ca33413e17fcbbf0 (patch)
treeb9415d0e2f6005a651276cbc40d23196a8c02ddf /lib/tty.js
parent0161ec87af3d71b10d8ce679c8a1a64358fae8dc (diff)
downloadandroid-node-v8-ca9eb718fbf2cd2c60c7aeb3ca33413e17fcbbf0.tar.gz
android-node-v8-ca9eb718fbf2cd2c60c7aeb3ca33413e17fcbbf0.tar.bz2
android-node-v8-ca9eb718fbf2cd2c60c7aeb3ca33413e17fcbbf0.zip
src, lib: update after internal api change
Libuv now returns errors directly. Make everything in src/ and lib/ follow suit. The changes to lib/ are not strictly necessary but they remove the need for the abominations that are process._errno and node::SetErrno().
Diffstat (limited to 'lib/tty.js')
-rw-r--r--lib/tty.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/tty.js b/lib/tty.js
index 5d60ec6608..5c854edf09 100644
--- a/lib/tty.js
+++ b/lib/tty.js
@@ -79,8 +79,9 @@ function WriteStream(fd) {
writable: true
});
- var winSize = this._handle.getWindowSize();
- if (winSize) {
+ var winSize = [];
+ var err = this._handle.getWindowSize(winSize);
+ if (!err) {
this.columns = winSize[0];
this.rows = winSize[1];
}
@@ -95,9 +96,10 @@ WriteStream.prototype.isTTY = true;
WriteStream.prototype._refreshSize = function() {
var oldCols = this.columns;
var oldRows = this.rows;
- var winSize = this._handle.getWindowSize();
- if (!winSize) {
- this.emit('error', errnoException(process._errno, 'getWindowSize'));
+ var winSize = [];
+ var err = this._handle.getWindowSize(winSize);
+ if (err) {
+ this.emit('error', errnoException(err, 'getWindowSize'));
return;
}
var newCols = winSize[0];