Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
powerpc-utils.4891
powerpc-utils-lparstat_Ignore_whitespace_at_beg...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File powerpc-utils-lparstat_Ignore_whitespace_at_beginning_of_proc_interrupts_SPU_line.patch of Package powerpc-utils.4891
commit b071e81d8cd71af496d5c5b36371c30449051def Author: John Allen <jallen@linux.vnet.ibm.com> Date: Fri Aug 26 15:29:58 2016 -0400 lparstat: Ignore whitespace at beginning of /proc/interrupts SPU line In the case that any interrupt number in /proc/interrupts exceeds 3 characters, whitespace will be placed at the beginning of the SPU line in order to keep the columns aligned. In that case, the current code will miss the SPU line. This patch skips any whitespace preceding the SPU line. Signed-off-by: John Allen <jallen@linux.vnet.ibm.com> diff --git a/src/lparstat.c b/src/lparstat.c index 200fced..f32b4ab 100644 --- a/src/lparstat.c +++ b/src/lparstat.c @@ -203,7 +203,7 @@ int parse_lparcfg() int parse_proc_ints() { FILE *f; - char *line; + char *line, *p; size_t n = 0; char *value; struct sysentry *se; @@ -216,11 +216,15 @@ int parse_proc_ints() } while (getline(&line, &n, f) != -1) { + p = line; + while (*p == ' ') + p++; + /* we just need the SPU line */ - if (line[0] != 'S' || line[1] != 'P' || line[2] != 'U') + if (p[0] != 'S' || p[1] != 'P' || p[2] != 'U') continue; - for (value = &line[5]; value[2] != 'S'; value += 11) { + for (value = &p[5]; value[2] != 'S'; value += 11) { int v; v = atoi(value); phint += v;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor