* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
- * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
+ * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
if (!s)
return &stats;
-#if defined(__FreeBSD__)
- if (strncmp(s, "/dev/", 5) == 0) {
- // supplied a /dev/device arg, so cut off the /dev part
- strncpy(device_name, s + 5, text_buffer_size);
- } else
-#endif
strncpy(device_name, s, text_buffer_size);
snprintf(stat_name, text_buffer_size, "/dev/%s", device_name);
if (dir < 0)
val = diskio->current_read;
- if (dir == 0)
+ else if (dir == 0)
val = diskio->current;
else
val = diskio->current_write;
ds->last_read = reads;
ds->last_write = writes;
}
- /* since the values in /proc/diskstats are absolute, we have to substract
+ /* since the values in /proc/diskstats are absolute, we have to subtract
* our last reading. The numbers stand for "sectors read", and we therefore
* have to divide by two to get KB */
ds->sample_read[0] = (reads - ds->last_read) / 2;