[process]linux: linux process status change to "R" not "Running" see #173

pull/177/head
Shirou WAKAYAMA 9 years ago
parent 4bb84648bf
commit 15a7edb712

@ -556,10 +556,7 @@ func (p *Process) fillFromStatus() error {
case "Name":
p.name = strings.Trim(value, " \t")
case "State":
// get between "(" and ")"
s := strings.Index(value, "(") + 1
e := strings.Index(value, ")")
p.status = value[s:e]
p.status = value[0:1]
case "Uid":
p.uids = make([]int32, 0, 4)
for _, i := range strings.Split(value, "\t") {

@ -152,7 +152,7 @@ func Test_Process_Status(t *testing.T) {
if err != nil {
t.Errorf("geting status error %v", err)
}
if !strings.HasPrefix(v, "S") && v != "running" && v != "sleeping" {
if v != "R" && v != "S" {
t.Errorf("could not get state %v", v)
}
}

Loading…
Cancel
Save