Don't consider pid of 0 when using systemd lookup in procstat (#5972)
This commit is contained in:
parent
d38f7600f8
commit
cc2f3b29e1
|
@ -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]))
|
||||||
|
|
Loading…
Reference in New Issue