From 457ffaef355400d863f2c83c8f20673a86897bd1 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 16 Nov 1996 00:15:32 +0000 Subject: (proc_stat_set_flags): Allow the user fetch hook to turn on non-user bits, even if they've already failed in the standard code. --- libps/procstat.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libps') diff --git a/libps/procstat.c b/libps/procstat.c index 461d8113..d25ace55 100644 --- a/libps/procstat.c +++ b/libps/procstat.c @@ -982,13 +982,16 @@ proc_stat_set_flags (struct proc_stat *ps, ps_flags_t flags) ps->failed |= (need & ~PSTAT_USER_MASK) & ~have; ps->flags = have; - need &= PSTAT_USER_MASK; /* Only consider user bits now. */ + need &= ~have; if (need && ps->context->user_hooks && ps->context->user_hooks->fetch) /* There is some user state we need to fetch. */ { have |= (*ps->context->user_hooks->fetch) (ps, need, have); - /* Update the flag state again having tried the user bits. */ - ps->failed |= need & ~have; + /* Update the flag state again having tried the user bits. We allow + the user hook to turn on non-user bits, in which case we remove them + from the failed set; the user hook may know some way of getting the + info that we don't. */ + ps->failed = (ps->failed | need) & ~have; ps->flags = have; } -- cgit v1.2.3