From: Ben Noordhuis Date: Thu, 18 Apr 2013 10:14:30 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/v0.10' X-Git-Tag: v0.11.1~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e190bf6a13f89e7503c61fc4199e531a5c8afbd;p=platform%2Fupstream%2Fnodejs.git Merge remote-tracking branch 'origin/v0.10' Conflicts: src/node_os.cc --- 8e190bf6a13f89e7503c61fc4199e531a5c8afbd diff --cc src/node_crypto.cc index b1cddff,667f1e3..43926c8 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@@ -1983,10 -1959,11 +1983,11 @@@ Handle Connection::GetNegotiated SSL_get0_next_proto_negotiated(ss->ssl_, &npn_proto, &npn_proto_len); if (!npn_proto) { - return False(); + return False(node_isolate); } - return String::New((const char*) npn_proto, npn_proto_len); + return scope.Close(String::New(reinterpret_cast(npn_proto), + npn_proto_len)); } else { return ss->selectedNPNProto_; } diff --cc src/node_os.cc index 614a10c,7f392a5..9b1b02d --- a/src/node_os.cc +++ b/src/node_os.cc @@@ -50,11 -57,10 +57,10 @@@ static Handle GetEndianness(cons } static Handle GetHostname(const Arguments& args) { - HandleScope scope; + HandleScope scope(node_isolate); - char s[255]; - int r = gethostname(s, 255); + char buf[MAXHOSTNAMELEN + 1]; - if (r < 0) { + if (gethostname(buf, sizeof(buf))) { #ifdef __POSIX__ return ThrowException(ErrnoException(errno, "gethostname")); #else // __MINGW32__ @@@ -66,17 -73,14 +73,14 @@@ } static Handle GetOSType(const Arguments& args) { - HandleScope scope; + HandleScope scope(node_isolate); #ifdef __POSIX__ - char type[256]; struct utsname info; - - uname(&info); - strncpy(type, info.sysname, strlen(info.sysname)); - type[strlen(info.sysname)] = 0; - - return scope.Close(String::New(type)); + if (uname(&info)) { + return ThrowException(ErrnoException(errno, "uname")); + } + return scope.Close(String::New(info.sysname)); #else // __MINGW32__ return scope.Close(String::New("Windows_NT")); #endif