diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-21 02:53:08 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-21 02:53:08 +0000 |
commit | 3de98b32d56c7d3f9aa023c9e1611cb8a0d370ac (patch) | |
tree | 3814351c1a8981af19ffa8a7c903daea462bc5d0 /chrome/browser/process_info_snapshot_mac.cc | |
parent | 733d42d8db0d2813eb53d6441ebc4e0d48bc5ace (diff) | |
download | chromium_src-3de98b32d56c7d3f9aa023c9e1611cb8a0d370ac.zip chromium_src-3de98b32d56c7d3f9aa023c9e1611cb8a0d370ac.tar.gz chromium_src-3de98b32d56c7d3f9aa023c9e1611cb8a0d370ac.tar.bz2 |
Mac: fix error message which mentions top instead of ps.
BUG=28357
TEST=none (unless you feel like mocking /bin/ps)
Review URL: http://codereview.chromium.org/426010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_info_snapshot_mac.cc')
-rw-r--r-- | chrome/browser/process_info_snapshot_mac.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/process_info_snapshot_mac.cc b/chrome/browser/process_info_snapshot_mac.cc index 7e8117b..611f8f4 100644 --- a/chrome/browser/process_info_snapshot_mac.cc +++ b/chrome/browser/process_info_snapshot_mac.cc @@ -25,10 +25,11 @@ ProcessInfoSnapshot::~ProcessInfoSnapshot() { // Note: we ignore the "tsiz" (text size) display option of ps because it's // always zero (tested on 10.5 and 10.6). bool ProcessInfoSnapshot::Sample(std::vector<base::ProcessId> pid_list) { + const char* kPsPathName = "/bin/ps"; Reset(); std::vector<std::string> argv; - argv.push_back("/bin/ps"); + argv.push_back(kPsPathName); // Get PID, PPID, (real) UID, effective UID, resident set size, virtual memory // size, and command. argv.push_back("-o"); @@ -44,7 +45,7 @@ bool ProcessInfoSnapshot::Sample(std::vector<base::ProcessId> pid_list) { CommandLine command_line(argv); if (!base::GetAppOutputRestricted(command_line, &output, (pid_list.size() + 10) * 100)) { - LOG(ERROR) << "Failure running /bin/ps to acquire data."; + LOG(ERROR) << "Failure running " << kPsPathName << " to acquire data."; return false; } @@ -70,18 +71,18 @@ bool ProcessInfoSnapshot::Sample(std::vector<base::ProcessId> pid_list) { in.ignore(1, ' '); // Eat the space. std::getline(in, proc_info.command); // Get the rest of the line. if (!in.good()) { - LOG(ERROR) << "Error parsing output from /usr/bin/top."; + LOG(ERROR) << "Error parsing output from " << kPsPathName << "."; return false; } // Make sure the new PID isn't already in our list. if (proc_info_entries_.find(proc_info.pid) != proc_info_entries_.end()) { - LOG(ERROR) << "Duplicate PID in output from /bin/ps."; + LOG(ERROR) << "Duplicate PID in output from " << kPsPathName << "."; return false; } if (!proc_info.pid || ! proc_info.vsize) { - LOG(WARNING) << "Invalid data from /bin/ps."; + LOG(WARNING) << "Invalid data from " << kPsPathName << "."; return false; } |