Fix unitialized proc_state.state when task_for_pid fails
This commit is contained in:
parent
babdfafa52
commit
89eb98a3f1
|
@ -1116,8 +1116,12 @@ int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid,
|
||||||
procstate->processor = SIGAR_FIELD_NOTIMPL;
|
procstate->processor = SIGAR_FIELD_NOTIMPL;
|
||||||
|
|
||||||
#ifdef DARWIN
|
#ifdef DARWIN
|
||||||
sigar_proc_threads_get(sigar, pid, procstate);
|
status = sigar_proc_threads_get(sigar, pid, procstate);
|
||||||
#else
|
if (status == SIGAR_OK) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (pinfo->KI_STAT) {
|
switch (pinfo->KI_STAT) {
|
||||||
case SIDL:
|
case SIDL:
|
||||||
procstate->state = 'D';
|
procstate->state = 'D';
|
||||||
|
@ -1135,7 +1139,6 @@ int sigar_proc_state_get(sigar_t *sigar, sigar_pid_t pid,
|
||||||
procstate->state = 'Z';
|
procstate->state = 'Z';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue