add specs for process scanner

This commit is contained in:
Dominic Breuker
2018-03-05 09:26:22 +01:00
committed by Dominic Breuker
parent 644d65be7b
commit 572ce2ef3e
2 changed files with 134 additions and 1 deletions

View File

@@ -64,7 +64,7 @@ func getPIDs() ([]int, error) {
if f.IsDir() {
name := f.Name()
pid, err := strconv.Atoi(name)
if err != nil {
if err != nil || pid <= 0 {
continue // not a pid
}
pids = append(pids, pid)