| Index: runtime/bin/platform_win.cc
|
| diff --git a/runtime/bin/platform_win.cc b/runtime/bin/platform_win.cc
|
| index e1f9ced1f427cbc1c7f782303cebaf8d1bc3eede..115cdf097e7632178343e4f3671fa42c676270f7 100644
|
| --- a/runtime/bin/platform_win.cc
|
| +++ b/runtime/bin/platform_win.cc
|
| @@ -3,6 +3,7 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| #include "bin/platform.h"
|
| +#include "bin/socket.h"
|
|
|
|
|
| bool Platform::Initialize() {
|
| @@ -23,6 +24,17 @@ const char* Platform::OperatingSystem() {
|
| }
|
|
|
|
|
| +bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
|
| + static bool socketInitialized = false;
|
| + if (!socketInitialized) {
|
| + // Initialize Socket for gethostname.
|
| + if (!Socket::Initialize()) return false;
|
| + socketInitialized = true;
|
| + }
|
| + return gethostname(buffer, buffer_length) == 0;
|
| +}
|
| +
|
| +
|
| char* Platform::StrError(int error_code) {
|
| static const int kBufferSize = 1024;
|
| char* error = static_cast<char*>(malloc(kBufferSize));
|
|
|