Merge pull request #269 from andhe/ppc64le

Allow clock field in /proc/cpuinfo as cpu MHz fallback value
This commit is contained in:
shirou 2016-10-15 21:41:39 +09:00 committed by GitHub
commit c2dd8ca3d4
1 changed files with 2 additions and 2 deletions

View File

@ -152,9 +152,9 @@ func Info() ([]InfoStat, error) {
return ret, err
}
c.Stepping = int32(t)
case "cpu MHz":
case "cpu MHz", "clock":
// treat this as the fallback value, thus we ignore error
if t, err := strconv.ParseFloat(value, 64); err == nil {
if t, err := strconv.ParseFloat(strings.Replace(value, "MHz", "", 1), 64); err == nil {
c.Mhz = t
}
case "cache size":