From ca9eb718fbf2cd2c60c7aeb3ca33413e17fcbbf0 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 18 Jul 2013 23:18:50 +0200 Subject: 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(). --- lib/tty.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/tty.js') 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]; -- cgit v1.2.3