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

Unified Diff: runtime/bin/process_linux.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: 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
« no previous file with comments | « no previous file | runtime/bin/process_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_linux.cc
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index bfaf4d4bf4aa933b05b40a4a8b90105f5c3b7782..8534dd9ed63dbe1e12b5ed549e7a9bf63539fbf5 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -17,6 +17,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.
@@ -461,15 +462,15 @@ 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)));
+ char **orig_environ = environ;
Mads Ager (google) 2012/10/26 08:43:44 char** orig_environ However, I don't think there
Bob Nystrom 2012/10/30 18:16:59 Removed.
ahe 2012/10/31 06:59:17 I don't understand your reasoning. ReportChildErr
+ if (program_environment != NULL) {
+ environ = program_environment;
}
+ TEMP_FAILURE_RETRY(
+ execvp(path, const_cast<char* const*>(program_arguments)));
+ // Dead code, unless execvp fails.
Mads Ager (google) 2012/10/26 08:43:44 I think we can remove this. It doesn't matter, doe
Bob Nystrom 2012/10/30 18:16:59 I don't think so? Done.
+ environ = orig_environ;
+
ReportChildError(exec_control[1]);
}
« no previous file with comments | « no previous file | runtime/bin/process_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698