aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-11-06 01:51:07 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2010-11-06 01:51:07 +0100
commit9135fd26c485f57a76a94775a66ac4ccf5188990 (patch)
treed63a2e4948342307280b508b3c443edd210df420
parent4909fec73eb3d4bbd2af17c2fb891b75291265e7 (diff)
parentdea28e1e558228d9c46cdb25c7f00986d9d52bcc (diff)
downloadbusybox-9135fd26c485f57a76a94775a66ac4ccf5188990.tar.gz
Merge branch 'master' of git+ssh://busybox.net/var/lib/git/busybox
-rw-r--r--procps/powertop.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/procps/powertop.c b/procps/powertop.c
index 4c3c3565e..da7f05258 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -323,18 +323,16 @@ static void process_irq_counts(void)
*/
*p = '\0';
/* Deal with non-maskable interrupts -- make up fake numbers */
- nr = index_in_strings("NMI\0RES\nCAL\0TLB\0TRM\0THR\0SPU\0", buf);
- if (nr != -1) {
+ nr = index_in_strings("NMI\0RES\0CAL\0TLB\0TRM\0THR\0SPU\0", buf);
+ if (nr >= 0) {
nr += 20000;
} else {
/* bb_strtou doesn't eat leading spaces, using strtoul */
+ errno = 0;
nr = strtoul(buf, NULL, 10);
+ if (errno)
+ continue;
}
- *p = ':';
-
- if (nr == -1)
- continue;
-
p++;
/* 0: 143646045 153901007 IO-APIC-edge timer
* ^
@@ -422,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 */