]> arthur.barton.de Git - netdata.git/commitdiff
fix for no lines being read in /proc/interrupts and /proc/softirqs #66
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 2 Apr 2016 14:33:02 +0000 (17:33 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 2 Apr 2016 14:33:02 +0000 (17:33 +0300)
src/proc_interrupts.c
src/proc_softirqs.c

index 25482dfa7eddb93e3626ad869a5eef79df98c946..8ebbd1c2caffc8d90ffb2b3921c60557b4b55b0c 100755 (executable)
@@ -46,6 +46,11 @@ int do_proc_interrupts(int update_every, unsigned long long dt) {
        uint32_t lines = procfile_lines(ff), l;
        uint32_t words = procfile_linewords(ff, 0), w;
 
+       if(!lines) {
+               error("Cannot read /proc/interrupts, zero lines reported.");
+               return 1;
+       }
+
        // find how many CPUs are there
        if(cpus == -1) {
                cpus = 0;
index 9373baaecae5f33da22a76bc54fab747dd013c4b..a601c7e350afd389bbd594e1ee8958017c6e6046 100755 (executable)
@@ -46,6 +46,11 @@ int do_proc_softirqs(int update_every, unsigned long long dt) {
        uint32_t lines = procfile_lines(ff), l;
        uint32_t words = procfile_linewords(ff, 0), w;
 
+       if(!lines) {
+               error("Cannot read /proc/softirqs, zero lines reported.");
+               return 1;
+       }
+
        // find how many CPUs are there
        if(cpus == -1) {
                cpus = 0;