summaryrefslogtreecommitdiff
path: root/lib/tty.js
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-07-16 23:28:38 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-07-20 12:04:35 +0200
commit0161ec87af3d71b10d8ce679c8a1a64358fae8dc (patch)
treefda63e078b5729cdb8c17329a90dad8306b003d9 /lib/tty.js
parentd4c14c1fe5402b8c3b1d582070ccbf3ae40f5b1f (diff)
downloadnode-0161ec87af3d71b10d8ce679c8a1a64358fae8dc.tar.gz
src, lib: deduplicate errnoException
Diffstat (limited to 'lib/tty.js')
-rw-r--r--lib/tty.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/tty.js b/lib/tty.js
index 98d498a17..5d60ec660 100644
--- a/lib/tty.js
+++ b/lib/tty.js
@@ -26,6 +26,9 @@ var TTY = process.binding('tty_wrap').TTY;
var isTTY = process.binding('tty_wrap').isTTY;
var util = require('util');
+var errnoException = util._errnoException;
+
+
exports.isatty = function(fd) {
return isTTY(fd);
};
@@ -123,12 +126,3 @@ WriteStream.prototype.clearScreenDown = function() {
WriteStream.prototype.getWindowSize = function() {
return [this.columns, this.rows];
};
-
-
-// TODO share with net_uv and others
-function errnoException(errorno, syscall) {
- var e = new Error(syscall + ' ' + errorno);
- e.errno = e.code = errorno;
- e.syscall = syscall;
- return e;
-}