mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-29 13:49:21 +08:00
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.
This commit is contained in:
parent
48fc561289
commit
d62768abc9
@ -66,7 +66,7 @@ func Partitions(all bool) ([]PartitionStat, error) {
|
|||||||
func IOCounters(names ...string) (map[string]IOCountersStat, error) {
|
func IOCounters(names ...string) (map[string]IOCountersStat, error) {
|
||||||
ret := make(map[string]IOCountersStat)
|
ret := make(map[string]IOCountersStat)
|
||||||
|
|
||||||
r, err := unix.Sysctl("hw.diskstats")
|
r, err := unix.SysctlRaw("hw.diskstats")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user