mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
fix interrupts.c to actually work
This commit is contained in:
parent
7c5a9a8c58
commit
1956b4dd7b
1 changed files with 7 additions and 4 deletions
|
@ -37,10 +37,13 @@ int interrupts(int argc, char **argv) {
|
|||
return 1;
|
||||
}
|
||||
while(fgets(buff, 256, f)) {
|
||||
if(!strncmp(buff, "intr ", 5))
|
||||
printf("intr.value %s", buff+5);
|
||||
else if(!strncmp(buff, "ctxt ", 5))
|
||||
printf("ctx.value %s", buff+5);
|
||||
if(!strncmp(buff, "intr ", 5)) {
|
||||
buff[5 + strcspn(buff + 5, " \t\n")] = '\0';
|
||||
printf("intr.value %s\n", buff+5);
|
||||
} else if(!strncmp(buff, "ctxt ", 5)) {
|
||||
buff[5 + strcspn(buff + 5, " \t\n")] = '\0';
|
||||
printf("ctx.value %s\n", buff+5);
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue