summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2014-11-03 01:28:31 -0800
committerDmitriy Ivanov <dimitry@google.com>2014-11-03 01:28:31 -0800
commit65267bcc27b81088ab6183f7c4abf06c3ce3b297 (patch)
treec4dfe9eeed8308e2c8ff3c4fa4e1ad6f65f73b64
parentc6dead707de7c03bd9759b61143dd33cb1435cbc (diff)
downloadsystem_core-65267bcc27b81088ab6183f7c4abf06c3ce3b297.zip
system_core-65267bcc27b81088ab6183f7c4abf06c3ce3b297.tar.gz
system_core-65267bcc27b81088ab6183f7c4abf06c3ce3b297.tar.bz2
Fix ps <process name>
Use /proc/pid/cmdline instead of /proc/pid/stat to filter process by name. Bug: 8638853 Change-Id: I469f55186e0d8b93311438cc8a1d0f73834f3fb5
-rw-r--r--toolbox/ps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toolbox/ps.c b/toolbox/ps.c
index 57b4280..4542bca 100644
--- a/toolbox/ps.c
+++ b/toolbox/ps.c
@@ -147,7 +147,7 @@ static int ps_line(int pid, int tid, char *namefilter)
strcpy(user,pw->pw_name);
}
- if(!namefilter || !strncmp(name, namefilter, strlen(namefilter))) {
+ if(!namefilter || !strncmp(cmdline[0] ? cmdline : name, namefilter, strlen(namefilter))) {
if (display_flags & SHOW_MACLABEL) {
fd = open(macline, O_RDONLY);
strcpy(macline, "-");