From bb692a0d9bd47f637d73fd8f6ebc08a400836410 Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Wed, 31 Oct 2018 10:14:03 +0700 Subject: [PATCH] disk plugin: Updated after review --- src/disk.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/disk.c b/src/disk.c index 41aacaaa..7edf44c7 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); -- 2.11.0