diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-06 01:51:07 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-06 01:51:07 +0100 |
commit | 9135fd26c485f57a76a94775a66ac4ccf5188990 (patch) | |
tree | d63a2e4948342307280b508b3c443edd210df420 | |
parent | 4909fec73eb3d4bbd2af17c2fb891b75291265e7 (diff) | |
parent | dea28e1e558228d9c46cdb25c7f00986d9d52bcc (diff) | |
download | busybox-w32-9135fd26c485f57a76a94775a66ac4ccf5188990.tar.gz busybox-w32-9135fd26c485f57a76a94775a66ac4ccf5188990.tar.bz2 busybox-w32-9135fd26c485f57a76a94775a66ac4ccf5188990.zip |
Merge branch 'master' of git+ssh://busybox.net/var/lib/git/busybox
-rw-r--r-- | procps/powertop.c | 16 |
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) | |||
323 | */ | 323 | */ |
324 | *p = '\0'; | 324 | *p = '\0'; |
325 | /* Deal with non-maskable interrupts -- make up fake numbers */ | 325 | /* Deal with non-maskable interrupts -- make up fake numbers */ |
326 | nr = index_in_strings("NMI\0RES\nCAL\0TLB\0TRM\0THR\0SPU\0", buf); | 326 | nr = index_in_strings("NMI\0RES\0CAL\0TLB\0TRM\0THR\0SPU\0", buf); |
327 | if (nr != -1) { | 327 | if (nr >= 0) { |
328 | nr += 20000; | 328 | nr += 20000; |
329 | } else { | 329 | } else { |
330 | /* bb_strtou doesn't eat leading spaces, using strtoul */ | 330 | /* bb_strtou doesn't eat leading spaces, using strtoul */ |
331 | errno = 0; | ||
331 | nr = strtoul(buf, NULL, 10); | 332 | nr = strtoul(buf, NULL, 10); |
333 | if (errno) | ||
334 | continue; | ||
332 | } | 335 | } |
333 | *p = ':'; | ||
334 | |||
335 | if (nr == -1) | ||
336 | continue; | ||
337 | |||
338 | p++; | 336 | p++; |
339 | /* 0: 143646045 153901007 IO-APIC-edge timer | 337 | /* 0: 143646045 153901007 IO-APIC-edge timer |
340 | * ^ | 338 | * ^ |
@@ -422,12 +420,12 @@ static NOINLINE int process_timer_stats(void) | |||
422 | int idx; | 420 | int idx; |
423 | 421 | ||
424 | count = skip_whitespace(buf); | 422 | count = skip_whitespace(buf); |
425 | if (strcmp(strchrnul(count, ' '), " total events") == 0) | ||
426 | break; | ||
427 | p = strchr(count, ','); | 423 | p = strchr(count, ','); |
428 | if (!p) | 424 | if (!p) |
429 | continue; | 425 | continue; |
430 | *p++ = '\0'; | 426 | *p++ = '\0'; |
427 | if (strcmp(skip_non_whitespace(count), " total events") == 0) | ||
428 | break; | ||
431 | if (strchr(count, 'D')) | 429 | if (strchr(count, 'D')) |
432 | continue; /* deferred */ | 430 | continue; /* deferred */ |
433 | p = skip_whitespace(p); /* points to pid now */ | 431 | p = skip_whitespace(p); /* points to pid now */ |