diff options
author | Miles Bader <miles@gnu.org> | 1996-06-24 21:35:48 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-06-24 21:35:48 +0000 |
commit | 039a88b329122f3f4d5e29f2bf59e77d80a04426 (patch) | |
tree | c284a04942f3f71fd5a9d4c4176ad85d3c3c4fb7 /utils | |
parent | f74b90d7e3174cca883b072903adaa7dc77c2724 (diff) |
(main): Fix heuristic to decide whether native booted.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/ps.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -569,9 +569,17 @@ main(int argc, char *argv[]) simple heuristic: Is the 5th process a hurd process (1-4 are typically: proc server, init, kernel, boot default pager (maybe); the last two are know not to be hurd processes)? */ - show_non_hurd_procs = - (procset->num_procs > 4 - && !(procset->proc_stats[4]->flags & PSTAT_STATE_P_NOPARENT)); + if (procset->num_procs > 4) + { + struct proc_stat *ps = procset->proc_stats[4]; + if (proc_stat_set_flags (ps, PSTAT_STATE) == 0 + && (ps->flags & PSTAT_STATE)) + show_non_hurd_procs = !(ps->state & PSTAT_STATE_P_NOPARENT); + else + /* Something is fucked, we can't get the state bits for PS. + Default to showing everything. */ + show_non_hurd_procs = 1; + } } if (no_msg_port) |