proc/interrupts needs more permissive parsing
When there was more than one leading spaces in the beginning of line, irq database was forced to rebuild. Signed-off-by: Petr Holasek <pholasek@redhat.com> Signed-offy-by: Neil Horman <nhorman@tuxdriver.com> --- procinterrupts.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/procinterrupts.c b/procinterrupts.c index d5555f2..2c1bb25 100644 --- a/procinterrupts.c +++ b/procinterrupts.c @@ -25,6 +25,7 @@ #include <stdint.h> #include <string.h> #include <syslog.h> +#include <ctype.h> #include "cpumask.h" #include "irqbalance.h" @@ -66,7 +67,10 @@ void parse_proc_interrupts(void) proc_int_has_msi = 1; /* lines with letters in front are special, like NMI count. Ignore */ - if (!(line[0]==' ' || (line[0]>='0' && line[0]<='9'))) + c = line; + while (isblank(*(c++))) + ; + if (!(*c>='0' && *c<='9')) break; c = strchr(line, ':'); if (!c) -- 1.7.6.4
This commit is contained in:
parent
327691a79b
commit
c4b8403e23
|
@ -25,6 +25,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "cpumask.h"
|
#include "cpumask.h"
|
||||||
#include "irqbalance.h"
|
#include "irqbalance.h"
|
||||||
|
@ -66,7 +67,10 @@ void parse_proc_interrupts(void)
|
||||||
proc_int_has_msi = 1;
|
proc_int_has_msi = 1;
|
||||||
|
|
||||||
/* lines with letters in front are special, like NMI count. Ignore */
|
/* lines with letters in front are special, like NMI count. Ignore */
|
||||||
if (!(line[0]==' ' || (line[0]>='0' && line[0]<='9')))
|
c = line;
|
||||||
|
while (isblank(*(c++)))
|
||||||
|
;
|
||||||
|
if (!(*c>='0' && *c<='9'))
|
||||||
break;
|
break;
|
||||||
c = strchr(line, ':');
|
c = strchr(line, ':');
|
||||||
if (!c)
|
if (!c)
|
||||||
|
|
Loading…
Reference in a new issue