29 |
|
proc_state_t *ps; |
30 |
|
int ps_size; |
31 |
|
int x; |
32 |
< |
char *state; |
32 |
> |
char *state = NULL; |
33 |
|
|
34 |
|
/* Initialise statgrab */ |
35 |
|
statgrab_init(); |
42 |
|
|
43 |
|
ps_size = get_proc_snapshot(&ps); |
44 |
|
|
45 |
< |
if(ps_size == NULL){ |
45 |
> |
if(ps_size == 0){ |
46 |
|
fprintf(stderr, "Failed to get process snapshot\n"); |
47 |
|
exit(1); |
48 |
|
} |
63 |
|
break; |
64 |
|
case ZOMBIE: |
65 |
|
state = "ZOMBIE"; |
66 |
+ |
break; |
67 |
+ |
case UNKNOWN: |
68 |
+ |
state = "UNKNOWN"; |
69 |
|
break; |
70 |
|
} |
71 |
|
printf("%5d %5d %5d %5d %5d %5d %5d %5dM %5dM %8ds %10f %4d %-8s %-20s %s\n", |