From dab27897c2ceca18312e7bf462fc1e87e48bc098 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Thu, 9 Apr 2009 10:41:11 +0000 Subject: [PATCH] Mac client: fill in command field of PROCINFO struct so log flag works properly on Mac. svn path=/trunk/boinc/; revision=17760 --- checkin_notes | 7 +++++++ lib/procinfo_mac.cpp | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index 8696ce21fa..803010df0a 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3708,3 +3708,10 @@ Charlie 8 Apr 2009 mac_build/ boinc.xcodeproj/ project.pbxproj + +Charlie 8 Apr 2009 + - Mac client: fill in command field of PROCINFO struct so + log flag works properly on Mac. + + lib/ + procinfo_mac.cpp diff --git a/lib/procinfo_mac.cpp b/lib/procinfo_mac.cpp index 1f7698ca67..a37470b239 100644 --- a/lib/procinfo_mac.cpp +++ b/lib/procinfo_mac.cpp @@ -52,6 +52,7 @@ int procinfo_setup(vector& pi) { // Some values of possible interest available from 'ps' command: // %cpu percentage cpu usage (alias pcpu) // %mem percentage memory usage (alias pmem) +// command command (executable name) // majflt total page faults // minflt total page reclaims // nswap total swaps in/out @@ -82,7 +83,7 @@ int procinfo_setup(vector& pi) { // root; this was perceived by some users as a security risk. - fd = popen("ps -axopid,ppid,rsz,vsz,pagein,time", "r"); + fd = popen("ps -axcopid,ppid,rsz,vsz,pagein,time,command", "r"); if (!fd) return 0; // Skip over the header line @@ -96,7 +97,8 @@ int procinfo_setup(vector& pi) { while (1) { memset(&p, 0, sizeof(p)); - c = fscanf(fd, "%d%d%d%d%ld%d:%lf\n", &p.id, &p.parentid, &real_mem, &virtual_mem, &p.page_fault_count, &hours, &p.user_time); + c = fscanf(fd, "%d%d%d%d%ld%d:%lf %[^\n]", &p.id, &p.parentid, &real_mem, + &virtual_mem, &p.page_fault_count, &hours, &p.user_time, p.command); if (c < 7) break; p.working_set_size = (double)real_mem * 1024.; p.swap_size = (double)virtual_mem * 1024.;