Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-10-20 03:53:07 +0400
committerRyan Dahl <ry@tinyclouds.org>2011-10-20 03:53:07 +0400
commit6cc42927d83adf2f89809ff54732e13f9376ff6c (patch)
treedc4674913a23541edaa37557fb4b5afcf16bb299 /src/pipe_wrap.cc
parent88af0c86357cf627cd7e7cc6f83f7f546754f6c3 (diff)
Display sys_errno when UV_UNKNOWN is returned
Diffstat (limited to 'src/pipe_wrap.cc')
-rw-r--r--src/pipe_wrap.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 1bf59bd2de9..a180b4b4d0c 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -11,7 +11,9 @@
PipeWrap* wrap = \
static_cast<PipeWrap*>(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)); \
}
@@ -113,7 +115,7 @@ Handle<Value> PipeWrap::Bind(const Arguments& args) {
int r = uv_pipe_bind(&wrap->handle_, *name);
// Error starting the pipe.
- if (r) SetErrno(uv_last_error(uv_default_loop()).code);
+ if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r));
}
@@ -129,7 +131,7 @@ Handle<Value> PipeWrap::Listen(const Arguments& args) {
int r = uv_listen((uv_stream_t*)&wrap->handle_, backlog, OnConnection);
// Error starting the pipe.
- if (r) SetErrno(uv_last_error(uv_default_loop()).code);
+ if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r));
}
@@ -182,7 +184,7 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) {
assert(wrap->object_.IsEmpty() == false);
if (status) {
- SetErrno(uv_last_error(uv_default_loop()).code);
+ SetErrno(uv_last_error(uv_default_loop()));
}
Local<Value> argv[3] = {
@@ -227,7 +229,7 @@ Handle<Value> PipeWrap::Connect(const Arguments& args) {
req_wrap->Dispatched();
if (r) {
- SetErrno(uv_last_error(uv_default_loop()).code);
+ SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap;
return scope.Close(v8::Null());
} else {