Don't consider pid of 0 when using systemd lookup in procstat (#5972)

This commit is contained in:
José Moreno Hanshing 2019-06-14 15:00:14 -04:00 committed by Daniel Nelson
parent d38f7600f8
commit cc2f3b29e1
1 changed files with 1 additions and 1 deletions

View File

@ -397,7 +397,7 @@ func (p *Procstat) systemdUnitPIDs() ([]PID, error) {
if !bytes.Equal(kv[0], []byte("MainPID")) { if !bytes.Equal(kv[0], []byte("MainPID")) {
continue continue
} }
if len(kv[1]) == 0 { if len(kv[1]) == 0 || bytes.Equal(kv[1], []byte("0")) {
return nil, nil return nil, nil
} }
pid, err := strconv.Atoi(string(kv[1])) pid, err := strconv.Atoi(string(kv[1]))