summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-11-04 22:30:11 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2010-11-04 22:30:11 (GMT)
commitdea28e1e558228d9c46cdb25c7f00986d9d52bcc (patch)
tree178fa466dea11782289f721a3c9992e4d981841f
parentdcb163aa8e7808b59aef3d3319c707e7d9ac4ce4 (diff)
downloadbusybox-dea28e1e558228d9c46cdb25c7f00986d9d52bcc.tar.gz
busybox-dea28e1e558228d9c46cdb25c7f00986d9d52bcc.tar.bz2
powertop: fix last line detection in process_timer_stats()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--procps/powertop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/procps/powertop.c b/procps/powertop.c
index 87efbe8..da7f052 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -420,12 +420,12 @@ static NOINLINE int process_timer_stats(void)
int idx;
count = skip_whitespace(buf);
- if (strcmp(strchrnul(count, ' '), " total events") == 0)
- break;
p = strchr(count, ',');
if (!p)
continue;
*p++ = '\0';
+ if (strcmp(skip_non_whitespace(count), " total events") == 0)
+ break;
if (strchr(count, 'D'))
continue; /* deferred */
p = skip_whitespace(p); /* points to pid now */