[cpu][mac] doesn't return error when cpu.frequency

pull/1192/head
shirou 3 years ago
parent 1ec4629e46
commit bde422a2ff

@ -87,10 +87,9 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
// Use the rated frequency of the CPU. This is a static value and does not // Use the rated frequency of the CPU. This is a static value and does not
// account for low power or Turbo Boost modes. // account for low power or Turbo Boost modes.
cpuFrequency, err := unix.SysctlUint64("hw.cpufrequency") cpuFrequency, err := unix.SysctlUint64("hw.cpufrequency")
if err != nil { if err == nil {
return ret, err
}
c.Mhz = float64(cpuFrequency) / 1000000.0 c.Mhz = float64(cpuFrequency) / 1000000.0
}
return append(ret, c), nil return append(ret, c), nil
} }

Loading…
Cancel
Save