related: fix inconsistencies in result type references

This patch is a response to errors found in those type
references now that our library allows for validation.

In two cases, former assignments to a result structure
could no longer employ that VAL macro if validation is
active. Thus, direct reference to some stack was used.

For the record, those instances were to be found here:
. ps - uses PIDS_extra to store the cooked pcpu values
. top - uses PIDS_extra to store the forest view level

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2016-08-05 00:00:00 -05:00
committed by Craig Small
parent e3270d463d
commit 105058ae2d
4 changed files with 17 additions and 12 deletions

View File

@ -267,7 +267,8 @@ static void value_this_proc_pcpu(proc_t *buf){
seconds = rSv(TIME_ELAPSED, ull_int, buf);
if(seconds) pcpu = (used_jiffies * 1000ULL / Hertz) / seconds;
rSv(extra, ul_int, buf) = pcpu;
// if xtra-procps-debug.h active, can't use PIDS_VAL as base due to assignment
buf->head[rel_extra].result.ul_int = pcpu;
}
}
@ -545,7 +546,6 @@ static void finalize_stacks (void)
chkREL(ID_SUID)
chkREL(ID_TGID)
chkREL(STATE)
chkREL(TIME_START)
chkREL(TTY)
// needed to creata an enhanced 'stat/state'
chkREL(ID_PGRP)
@ -561,8 +561,11 @@ static void finalize_stacks (void)
chkREL(SIGNALS)
chkREL(SIGPENDING)
// needed with loss of defunct 'cook_time' macros
chkREL(TICS_ALL)
chkREL(TICS_ALL_C)
chkREL(TIME_ALL)
chkREL(TIME_ELAPSED)
chkREL(TIME_START)
// special items with 'extra' used as former pcpu
chkREL(extra)
chkREL(noop)