summaryrefslogtreecommitdiff
path: root/src/tty_wrap.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-10-19 16:53:07 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-10-19 16:53:07 -0700
commit6cc42927d83adf2f89809ff54732e13f9376ff6c (patch)
treedc4674913a23541edaa37557fb4b5afcf16bb299 /src/tty_wrap.cc
parent88af0c86357cf627cd7e7cc6f83f7f546754f6c3 (diff)
downloadandroid-node-v8-6cc42927d83adf2f89809ff54732e13f9376ff6c.tar.gz
android-node-v8-6cc42927d83adf2f89809ff54732e13f9376ff6c.tar.bz2
android-node-v8-6cc42927d83adf2f89809ff54732e13f9376ff6c.zip
Display sys_errno when UV_UNKNOWN is returned
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r--src/tty_wrap.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index eaa8cfdcd4..6272d45f29 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -27,7 +27,9 @@ using v8::Undefined;
TTYWrap* wrap = \
static_cast<TTYWrap*>(args.Holder()->GetPointerFromInternalField(0)); \
if (!wrap) { \
- SetErrno(UV_EBADF); \
+ uv_err_t err; \
+ err.code = UV_EBADF; \
+ SetErrno(err); \
return scope.Close(Integer::New(-1)); \
}
@@ -100,7 +102,7 @@ class TTYWrap : StreamWrap {
int r = uv_tty_get_winsize(&wrap->handle_, &width, &height);
if (r) {
- SetErrno(uv_last_error(uv_default_loop()).code);
+ SetErrno(uv_last_error(uv_default_loop()));
return v8::Undefined();
}
@@ -119,7 +121,7 @@ class TTYWrap : StreamWrap {
int r = uv_tty_set_mode(&wrap->handle_, args[0]->IsTrue());
if (r) {
- SetErrno(uv_last_error(uv_default_loop()).code);
+ SetErrno(uv_last_error(uv_default_loop()));
}
return scope.Close(Integer::New(r));