From: Pavel Rochnyack Date: Wed, 31 Oct 2018 03:14:03 +0000 (+0700) Subject: disk plugin: Updated after review X-Git-Tag: collectd-5.9.0~88^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb692a0d9bd47f637d73fd8f6ebc08a400836410;p=thirdparty%2Fcollectd.git disk plugin: Updated after review --- diff --git a/src/disk.c b/src/disk.c index 41aacaaa0..7edf44c78 100644 --- a/src/disk.c +++ b/src/disk.c @@ -820,7 +820,7 @@ static int disk_read(void) { ds->poll_count = poll_count; continue; } - ds->poll_count++; + ds->poll_count = poll_count; if ((read_ops == 0) && (write_ops == 0)) { DEBUG("disk plugin: ((read_ops == 0) && " @@ -884,14 +884,12 @@ static int disk_read(void) { /* Disk is missing, remove it */ diskstats_t *missing_ds = ds; - if (pre_ds == disklist) { - disklist = ds->next; - ds = disklist; - pre_ds = ds; + if (ds == disklist) { + pre_ds = disklist = ds->next; } else { pre_ds->next = ds->next; - ds = ds->next; } + ds = ds->next; DEBUG("disk plugin: Disk %s disappeared.", missing_ds->name); free(missing_ds->name);