make unit of all temperatures selectable
[monky] / src / diskio.c
index 8796f0a..515f323 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "conky.h"
 #include <limits.h>
-#include <stdio.h>
 /* The following ifdefs were adapted from gkrellm */
 #include <linux/major.h>
 
@@ -87,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;
@@ -146,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;
        }
 
@@ -223,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);
 }