diff options
| author | rsc <rsc> | 2007-08-08 09:42:36 +0000 | 
|---|---|---|
| committer | rsc <rsc> | 2007-08-08 09:42:36 +0000 | 
| commit | 19b1f63813072a57c5b2d620049a4cb7f55b8af6 (patch) | |
| tree | 323ec72bc23eaa396dcdef4ce787bdb524504189 | |
| parent | 453c6a65a20a70260e0b86a16192a65660efcbe1 (diff) | |
| download | xv6-labs-19b1f63813072a57c5b2d620049a4cb7f55b8af6.tar.gz xv6-labs-19b1f63813072a57c5b2d620049a4cb7f55b8af6.tar.bz2 xv6-labs-19b1f63813072a57c5b2d620049a4cb7f55b8af6.zip  | |
cleaner table
| -rw-r--r-- | proc.c | 18 | 
1 files changed, 9 insertions, 9 deletions
@@ -422,12 +422,12 @@ void  procdump(void)  {    static char *states[] = { -    "unused", -    "embryo", -    "sleep ", -    "runble", -    "run   ", -    "zombie" +  [UNUSED]    "unused", +  [EMBRYO]    "embryo", +  [SLEEPING]  "sleep ", +  [RUNNABLE]  "runble", +  [RUNNING]   "run   ", +  [ZOMBIE]    "zombie"    };    int i;    struct proc *p; @@ -437,10 +437,10 @@ procdump(void)      p = &proc[i];      if(p->state == UNUSED)        continue; -    if(p->state < 0 || p->state > ZOMBIE) -      state = "???"; -    else +    if(p->state >= 0 && p->state < NELEM(states))        state = states[p->state]; +    else +      state = "???";      cprintf("%d %s %s\n", p->pid, state, p->name);    }  }  | 
