Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: runtime/bin/process_macos.cc

Issue 1174903002: Revert execvpe on Mac and fix usage of strerror_r. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_macos.cc
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index f97737690bf65327cf197f68148d5d4aff64e5ef..de7f149cb8f33b9cbaabb196bca4a7f81974912c 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -25,6 +25,9 @@
#include "platform/signal_blocker.h"
+extern char** environ;
+
+
namespace dart {
namespace bin {
@@ -449,14 +452,12 @@ class ProcessStarter {
}
if (program_environment_ != NULL) {
- VOID_TEMP_FAILURE_RETRY(
- execvpe(path_, const_cast<char* const*>(program_arguments_),
- program_environment_));
- } else {
- VOID_TEMP_FAILURE_RETRY(
- execvp(path_, const_cast<char* const*>(program_arguments_)));
+ environ = program_environment_;
}
+ VOID_TEMP_FAILURE_RETRY(
+ execvp(path_, const_cast<char* const*>(program_arguments_)));
+
ReportChildError();
}
@@ -682,14 +683,8 @@ class ProcessStarter {
void SetOSErrorMessage(int child_errno) {
const int kMaxMessageSize = 256;
char* message = static_cast<char*>(calloc(kMaxMessageSize, 0));
- char* os_error_message = strerror_r(
- child_errno, message, kMaxMessageSize - 1);
- if (message == os_error_message) {
- *os_error_message_ = message;
- } else {
- free(message);
- *os_error_message_ = strdup(os_error_message);
- }
+ strerror_r(child_errno, message, kMaxMessageSize - 1);
+ *os_error_message_ = message;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698