diff --git a/cpu_test.go b/cpu_test.go index 15b6705..202ff36 100644 --- a/cpu_test.go +++ b/cpu_test.go @@ -11,7 +11,7 @@ func TestCpu_times(t *testing.T) { t.Errorf("error %v", err) } if len(v) == 0 { - t.Errorf("could not get CPUs ", err) + t.Error("could not get CPUs ", err) } empty := CPUTimesStat{} for _, vv := range v { diff --git a/process_posix.go b/process_posix.go index e52fed3..03bd5d8 100644 --- a/process_posix.go +++ b/process_posix.go @@ -41,7 +41,9 @@ func getTerminalMap() (map[uint64]string, error) { for _, name := range termfiles { stat := syscall.Stat_t{} - syscall.Stat(name, &stat) + if err = syscall.Stat(name, &stat); err != nil { + return nil, err + } rdev := uint64(stat.Rdev) ret[rdev] = strings.Replace(name, "/dev", "", -1) }