summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-11-16 00:15:32 +0000
committerMiles Bader <miles@gnu.org>1996-11-16 00:15:32 +0000
commit457ffaef355400d863f2c83c8f20673a86897bd1 (patch)
tree02c31536fc8e6bad4d27ae64598fc635eae392a0
parent5b0f97db93a76e2b6d99acb959071f60ca456d0c (diff)
(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.
-rw-r--r--libps/procstat.c9
1 files changed, 6 insertions, 3 deletions
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;
}