From ed72caa3cd17f3762a1f018b048714612ccf8de3 Mon Sep 17 00:00:00 2001 From: Anders Johnsen Date: Wed, 10 Jun 2015 12:31:31 +0200 Subject: [PATCH] Revert and fix more of the mac change. BUG= Review URL: https://codereview.chromium.org//1175603003. --- runtime/bin/process_macos.cc | 18 +++++++++--------- tests/standalone/standalone.status | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc index de7f149cb8f3..6d628086f4a8 100644 --- a/runtime/bin/process_macos.cc +++ b/runtime/bin/process_macos.cc @@ -452,7 +452,10 @@ class ProcessStarter { } if (program_environment_ != NULL) { - environ = program_environment_; + // On MacOS you have to do a bit of magic to get to the + // environment strings. + char*** environ = _NSGetEnviron(); + *environ = program_environment_; } VOID_TEMP_FAILURE_RETRY( @@ -653,10 +656,7 @@ class ProcessStarter { void SetChildOsErrorMessage() { - const int kBufferSize = 1024; - char error_message[kBufferSize]; - strerror_r(errno, error_message, kBufferSize); - *os_error_message_ = strdup(error_message); + SetOSErrorMessage(errno); } @@ -681,10 +681,10 @@ class ProcessStarter { void SetOSErrorMessage(int child_errno) { - const int kMaxMessageSize = 256; - char* message = static_cast(calloc(kMaxMessageSize, 0)); - strerror_r(child_errno, message, kMaxMessageSize - 1); - *os_error_message_ = message; + const int kBufferSize = 1024; + char error_message[kBufferSize]; + strerror_r(child_errno, error_message, kBufferSize); + *os_error_message_ = strdup(error_message); } diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status index 691f6d979d38..687b66fc51f0 100644 --- a/tests/standalone/standalone.status +++ b/tests/standalone/standalone.status @@ -42,6 +42,7 @@ io/directory_fuzz_test: Skip # This is expected as MacOS by default runs with a very low number # of allowed open files ('ulimit -n' says something like 256). io/socket_many_connections_test: Skip +io/platform_executable_test/06: RuntimeError [ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ] typed_array_test: Fail # Issue 13921