make unit of all temperatures selectable
[monky] / src / diskio.c
index e0c65d8..515f323 100644 (file)
@@ -86,16 +86,12 @@ struct diskio_stat *prepare_diskio_stat(const char *s)
                free(new->dev);
                new->dev = 0;
        }
-       if (strncmp(s, "/dev/", 5) == 0) {
-               // supplied a /dev/device arg, so cut off the /dev part
-               new->dev = strndup(s + 5, text_buffer_size);
-       } else {
-               new->dev = strndup(s, text_buffer_size);
-       }
+       new->dev = strndup(s, text_buffer_size);
+
        /*
         * check that device actually exists
         */
-       
+
        if (!(fp = open_file("/proc/diskstats", &rep))) {
                ERR("cannot read from /proc/diskstats");
                return 0;
@@ -145,7 +141,7 @@ void update_diskio(void)
        int tot, tot_read, tot_write;
 
        if (!(fp = open_file("/proc/diskstats", &rep))) {
-               diskio_value = 0;
+               info.diskio_value = 0;
                return;
        }
 
@@ -222,9 +218,9 @@ void update_diskio(void)
        last_read = current_read;
        last_write = current_write;
 
-       diskio_value = tot;
-       diskio_read_value = tot_read;
-       diskio_write_value = tot_write;
+       info.diskio_value = tot;
+       info.diskio_read_value = tot_read;
+       info.diskio_write_value = tot_write;
 
        fclose(fp);
 }