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

Unified Diff: runtime/bin/process_macos.cc

Issue 11260048: Look up executable on PATH when given environment variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove dead code and add tests. Created 8 years, 2 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
Index: runtime/bin/process_macos.cc
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index b23ab169c394993e3df69baaa88df1f44857ad7b..11aac9f07d8b8c294e92dfa6be56cbff1cb57786 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -16,6 +16,7 @@
#include "bin/fdutils.h"
#include "bin/thread.h"
+extern char **environ;
// ProcessInfo is used to map a process id to the file descriptor for
// the pipe used to communicate the exit code of the process to Dart.
@@ -460,15 +461,13 @@ int Process::Start(const char* path,
ReportChildError(exec_control[1]);
}
- if (environment != NULL) {
- TEMP_FAILURE_RETRY(
- execve(path,
- const_cast<char* const*>(program_arguments),
- program_environment));
- } else {
- TEMP_FAILURE_RETRY(
- execvp(path, const_cast<char* const*>(program_arguments)));
+ if (program_environment != NULL) {
+ environ = program_environment;
}
+
+ TEMP_FAILURE_RETRY(
+ execvp(path, const_cast<char* const*>(program_arguments)));
+
ReportChildError(exec_control[1]);
}

Powered by Google App Engine
This is Rietveld 408576698