X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdisk.c;h=7edf44c7811f0ba6327f30cdc0f597d5128d2626;hb=28e701a07d1ea28b12d0e7c2e6ce57c993b2d509;hp=41aacaaa00d7bd0184e989841d802b9df9fe018a;hpb=f60c0fe787fce798f5c91a02c5258083aeb95fbc;p=collectd.git 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);