From: Pavel Rochnyack Date: Tue, 30 Oct 2018 14:53:11 +0000 (+0700) Subject: disk plugin: Fix regression after #2955 (Drop support for Linux 2.4) X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0ac4011bb728f8716082a3ddea4f112acc2c86e5;p=collectd.git disk plugin: Fix regression after #2955 (Drop support for Linux 2.4) Issue: #2955 --- diff --git a/src/disk.c b/src/disk.c index c78df4ec..b2285c18 100644 --- a/src/disk.c +++ b/src/disk.c @@ -662,9 +662,6 @@ static int disk_read(void) { char buffer[1024]; char *fields[32]; - int numfields; - - int minor = 0; derive_t read_sectors = 0; derive_t write_sectors = 0; @@ -691,14 +688,12 @@ static int disk_read(void) { char *disk_name; char *output_name; - numfields = strsplit(buffer, fields, 32); + int numfields = strsplit(buffer, fields, 32); /* need either 7 fields (partition) or at least 14 fields */ if ((numfields != 7) && (numfields < 14)) continue; - minor = atoll(fields[1]); - disk_name = fields[2]; for (ds = disklist, pre_ds = disklist; ds != NULL; @@ -736,18 +731,16 @@ static int disk_read(void) { read_sectors = atoll(fields[5]); write_sectors = atoll(fields[9]); - if (minor == 0) { - is_disk = 1; - read_merged = atoll(fields[4]); - read_time = atoll(fields[6]); - write_merged = atoll(fields[8]); - write_time = atoll(fields[10]); + is_disk = 1; + read_merged = atoll(fields[4]); + read_time = atoll(fields[6]); + write_merged = atoll(fields[8]); + write_time = atoll(fields[10]); - in_progress = atof(fields[11]); + in_progress = atof(fields[11]); - io_time = atof(fields[12]); - weighted_time = atof(fields[13]); - } + io_time = atof(fields[12]); + weighted_time = atof(fields[13]); } {