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

Unified Diff: runtime/bin/process_linux.cc

Issue 9108008: Add optional workingDirectory argument to Process.start. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 12 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_linux.cc
===================================================================
--- runtime/bin/process_linux.cc (revision 2981)
+++ runtime/bin/process_linux.cc (working copy)
@@ -133,6 +133,7 @@
int Process::Start(const char* path,
char* arguments[],
intptr_t arguments_length,
+ const char* working_directory,
intptr_t* in,
intptr_t* out,
intptr_t* err,
@@ -260,6 +261,10 @@
}
close(read_err[1]);
+ if (working_directory != NULL && chdir(working_directory) == -1) {
+ ReportChildError(exec_control[1]);
+ }
+
execvp(path, const_cast<char* const*>(program_arguments));
ReportChildError(exec_control[1]);
}

Powered by Google App Engine
This is Rietveld 408576698