From 74784b63d627d3988234399de074d3bee5bf23f6 Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 6 Mar 2013 01:07:46 -0800 Subject: [PATCH] cares: Set process._errno, not global.errno This makes test-internet pass --- src/cares_wrap.cc | 6 +++--- src/node.cc | 4 +++- src/node_internals.h | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 4cfe4b2ea5..22c7ec4975 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -261,9 +261,9 @@ static const char* AresErrnoString(int errorno) { static void SetAresErrno(int errorno) { HandleScope scope; - Handle key = String::NewSymbol("errno"); - Handle value = String::NewSymbol(AresErrnoString(errorno)); - Context::GetCurrent()->Global()->Set(key, value); + Local key = String::NewSymbol("_errno"); + Local value = String::NewSymbol(AresErrnoString(errorno)); + node::process->Set(key, value); } diff --git a/src/node.cc b/src/node.cc index 25354e9d84..2793d19c62 100644 --- a/src/node.cc +++ b/src/node.cc @@ -99,7 +99,9 @@ ngx_queue_t req_wrap_queue = { &req_wrap_queue, &req_wrap_queue }; Persistent process_symbol; Persistent domain_symbol; -static Persistent process; +// declared in node_internals.h +Persistent process; + static Persistent process_tickDomainCallback; static Persistent process_tickFromSpinner; static Persistent process_tickCallback; diff --git a/src/node_internals.h b/src/node_internals.h index 50f826dd80..0502ec9058 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -31,6 +31,9 @@ namespace node { // Defined in node.cc extern v8::Isolate* node_isolate; +// Defined in node.cc at startup. +extern v8::Persistent process; + #ifdef _WIN32 // emulate snprintf() on windows, _snprintf() doesn't zero-terminate the buffer // on overflow...