Browse Source

cares: Set process._errno, not global.errno

This makes test-internet pass
v0.9.12-release
isaacs 12 years ago
committed by Fedor Indutny
parent
commit
74784b63d6
  1. 6
      src/cares_wrap.cc
  2. 4
      src/node.cc
  3. 3
      src/node_internals.h

6
src/cares_wrap.cc

@ -261,9 +261,9 @@ static const char* AresErrnoString(int errorno) {
static void SetAresErrno(int errorno) { static void SetAresErrno(int errorno) {
HandleScope scope; HandleScope scope;
Handle<Value> key = String::NewSymbol("errno"); Local<Value> key = String::NewSymbol("_errno");
Handle<Value> value = String::NewSymbol(AresErrnoString(errorno)); Local<Value> value = String::NewSymbol(AresErrnoString(errorno));
Context::GetCurrent()->Global()->Set(key, value); node::process->Set(key, value);
} }

4
src/node.cc

@ -99,7 +99,9 @@ ngx_queue_t req_wrap_queue = { &req_wrap_queue, &req_wrap_queue };
Persistent<String> process_symbol; Persistent<String> process_symbol;
Persistent<String> domain_symbol; Persistent<String> domain_symbol;
static Persistent<Object> process; // declared in node_internals.h
Persistent<Object> process;
static Persistent<Function> process_tickDomainCallback; static Persistent<Function> process_tickDomainCallback;
static Persistent<Function> process_tickFromSpinner; static Persistent<Function> process_tickFromSpinner;
static Persistent<Function> process_tickCallback; static Persistent<Function> process_tickCallback;

3
src/node_internals.h

@ -31,6 +31,9 @@ namespace node {
// Defined in node.cc // Defined in node.cc
extern v8::Isolate* node_isolate; extern v8::Isolate* node_isolate;
// Defined in node.cc at startup.
extern v8::Persistent<v8::Object> process;
#ifdef _WIN32 #ifdef _WIN32
// emulate snprintf() on windows, _snprintf() doesn't zero-terminate the buffer // emulate snprintf() on windows, _snprintf() doesn't zero-terminate the buffer
// on overflow... // on overflow...

Loading…
Cancel
Save