cleaner table
This commit is contained in:
parent
453c6a65a2
commit
19b1f63813
18
proc.c
18
proc.c
|
@ -422,12 +422,12 @@ void
|
||||||
procdump(void)
|
procdump(void)
|
||||||
{
|
{
|
||||||
static char *states[] = {
|
static char *states[] = {
|
||||||
"unused",
|
[UNUSED] "unused",
|
||||||
"embryo",
|
[EMBRYO] "embryo",
|
||||||
"sleep ",
|
[SLEEPING] "sleep ",
|
||||||
"runble",
|
[RUNNABLE] "runble",
|
||||||
"run ",
|
[RUNNING] "run ",
|
||||||
"zombie"
|
[ZOMBIE] "zombie"
|
||||||
};
|
};
|
||||||
int i;
|
int i;
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
|
@ -437,10 +437,10 @@ procdump(void)
|
||||||
p = &proc[i];
|
p = &proc[i];
|
||||||
if(p->state == UNUSED)
|
if(p->state == UNUSED)
|
||||||
continue;
|
continue;
|
||||||
if(p->state < 0 || p->state > ZOMBIE)
|
if(p->state >= 0 && p->state < NELEM(states))
|
||||||
state = "???";
|
|
||||||
else
|
|
||||||
state = states[p->state];
|
state = states[p->state];
|
||||||
|
else
|
||||||
|
state = "???";
|
||||||
cprintf("%d %s %s\n", p->pid, state, p->name);
|
cprintf("%d %s %s\n", p->pid, state, p->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue