Fix IOCounters for OpenBSD

Use SysctlRaw instead of Sysctl.
The latter assumes NUL terminated strings
which returns the lenght off by one.
Therefore, only n-1 disks where reported.
pull/448/head
Marco Pfatschbacher 7 years ago
parent 48fc561289
commit d62768abc9

@ -66,7 +66,7 @@ func Partitions(all bool) ([]PartitionStat, error) {
func IOCounters(names ...string) (map[string]IOCountersStat, error) {
ret := make(map[string]IOCountersStat)
r, err := unix.Sysctl("hw.diskstats")
r, err := unix.SysctlRaw("hw.diskstats")
if err != nil {
return nil, err
}

Loading…
Cancel
Save