Fixed missing error handling, error msg

This commit is contained in:
Lukas Lueg 2014-08-15 19:09:43 +02:00
parent 026f5023a8
commit 90ffa84856
2 changed files with 4 additions and 2 deletions

View File

@ -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 {

View File

@ -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)
}