]> granicus.if.org Git - sysstat/commitdiff
iostat: Use the right major and minor numbers to read partitions stats
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 20 Jul 2019 08:42:48 +0000 (10:42 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 20 Jul 2019 08:42:48 +0000 (10:42 +0200)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
iostat.c

index 153462fd4d0444fc51b139d7d1b9946062a61b40..a54c3f804d4eb16a25bcc1b4a23f2baebd3a4b91 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -526,7 +526,7 @@ int read_sysfs_part_stat(int curr, struct io_device *d)
 
        /* Read stats for device */
        snprintf(dfile, sizeof(dfile), "%s/%d:%d/%s",
-                SYSFS_DEV_BLOCK, major, minor, S_STAT);
+                SYSFS_DEV_BLOCK, d->major, d->minor, S_STAT);
        dfile[sizeof(dfile) - 1] = '\0';
 
        return read_sysfs_file_stat(dfile, d->dev_stats[curr]);
@@ -548,7 +548,7 @@ void read_sysfs_dlist_stat(int curr)
 
        for (dlist = dev_list; dlist != NULL; dlist = dlist->next) {
                if (dlist->exist)
-                       /* Device statis already read */
+                       /* Device stats already read */
                        continue;
 
                else if (dlist->dev_tp == T_PART) {