diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 20:30:15 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 20:30:15 +0000 |
commit | 333887630a7acb82cde382820650033b18532d73 (patch) | |
tree | 0524f3a857afe410887e6becef25872d975a4474 /base/process_util_win.cc | |
parent | ea6e33667659f0d3fea27bd64a80a412d4b02bca (diff) | |
download | chromium_src-333887630a7acb82cde382820650033b18532d73.zip chromium_src-333887630a7acb82cde382820650033b18532d73.tar.gz chromium_src-333887630a7acb82cde382820650033b18532d73.tar.bz2 |
Harmonizing ProcessUtil::GetAppOutput on Win/Unix
BUG=None
TEST=Run the base unit-tests
Review URL: http://codereview.chromium.org/119190
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17660 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_win.cc')
-rw-r--r-- | base/process_util_win.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/base/process_util_win.cc b/base/process_util_win.cc index 8b9ede8..008cffa 100644 --- a/base/process_util_win.cc +++ b/base/process_util_win.cc @@ -198,12 +198,7 @@ bool KillProcessById(ProcessId process_id, int exit_code, bool wait) { return ret; } -bool GetAppOutput(const std::wstring& cmd_line, std::string* output) { - if (!output) { - NOTREACHED(); - return false; - } - +bool GetAppOutput(const CommandLine& cl, std::string* output) { HANDLE out_read = NULL; HANDLE out_write = NULL; @@ -241,7 +236,9 @@ bool GetAppOutput(const std::wstring& cmd_line, std::string* output) { start_info.dwFlags |= STARTF_USESTDHANDLES; // Create the child process. - if (!CreateProcess(NULL, const_cast<wchar_t*>(cmd_line.c_str()), NULL, NULL, + if (!CreateProcess(NULL, + const_cast<wchar_t*>(cl.command_line_string().c_str()), + NULL, NULL, TRUE, // Handles are inherited. 0, NULL, NULL, &start_info, &proc_info)) { NOTREACHED() << "Failed to start process"; |