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

Unified Diff: base/process/launch_posix.cc

Issue 885423003: Add the ability to change directories before execing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: No more changing directory. Created 5 years, 11 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 | « base/process/launch.h ('k') | base/process/process_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/launch_posix.cc
diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc
index ce93d5056fd838bf332da563186c5bc704130e22..921e263ae834bd4a0010f26623036ee81665e900 100644
--- a/base/process/launch_posix.cc
+++ b/base/process/launch_posix.cc
@@ -516,6 +516,10 @@ Process LaunchProcess(const std::vector<std::string>& argv,
#endif
#if defined(OS_POSIX)
+ if (!options.current_directory.empty()) {
+ RAW_CHECK(chdir(options.current_directory.value().c_str()) == 0);
jln (very slow on Chromium) 2015/02/03 02:07:53 Sorry I didn't comment on that before: you need to
rickyz (no longer on Chrome) 2015/02/03 02:17:56 Sure, I moved another c_str caller up as well.
+ }
+
if (options.pre_exec_delegate != nullptr) {
options.pre_exec_delegate->RunAsyncSafe();
}
« no previous file with comments | « base/process/launch.h ('k') | base/process/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698