#include "conky.h"
#include <limits.h>
-#include <stdio.h>
/* The following ifdefs were adapted from gkrellm */
#include <linux/major.h>
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;
int tot, tot_read, tot_write;
if (!(fp = open_file("/proc/diskstats", &rep))) {
- diskio_value = 0;
+ info.diskio_value = 0;
return;
}
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);
}