diff --git a/qa/1321 b/qa/1321 index f7e6ee7711..66cf420716 100755 --- a/qa/1321 +++ b/qa/1321 @@ -72,7 +72,7 @@ done # When new dynamic metrics are detected, the _next_ fetch will fetch them. # So wait for a bit so pmlogger has a chance to fetch the new metrics. -sleep 2 +sleep 3 # now kill pmlogger and check the new metrics appeared dynamically $sudo $PCP_BINADM_DIR/pmsignal -s TERM $pmlogger_pid >/dev/null 2>&1 diff --git a/src/libpcp_pmda/src/callback.c b/src/libpcp_pmda/src/callback.c index eedd80d486..c75a4b52e0 100644 --- a/src/libpcp_pmda/src/callback.c +++ b/src/libpcp_pmda/src/callback.c @@ -476,18 +476,18 @@ pmdaInstance(pmInDom indom, int inst, char *name, pmInResult **result, pmdaExt * * The first byte of the (unused) timestamp field has been * co-opted as a flags byte - now indicating state changes * that have happened within a PMDA and that need to later - * be propogated through to any connected clients. + * be propagated through to any connected clients. */ static void __pmdaEncodeStatus(pmdaResult *result, unsigned char byte) { - unsigned char *flags; + uint64_t *flags; memset(&result->timestamp, 0, sizeof(result->timestamp)); if (byte) { - flags = (unsigned char *)&result->timestamp; - *flags |= byte; + flags = (uint64_t *)&result->timestamp; + *flags = byte; } } diff --git a/src/pmcd/src/dofetch.c b/src/pmcd/src/dofetch.c index 33a731b5ec..8795f10220 100644 --- a/src/pmcd/src/dofetch.c +++ b/src/pmcd/src/dofetch.c @@ -356,9 +356,11 @@ SendFetch(DomPmidList *dpList, AgentInfo *aPtr, ClientInfo *cPtr, int ctxnum) static int ExtractState(int i, void *timestamp) { - unsigned char byte; + uint64_t full_value; + + memcpy(&full_value, timestamp, sizeof(uint64_t)); + unsigned char byte = (unsigned char)full_value; - memcpy(&byte, timestamp, sizeof(unsigned char)); /* * integrity checks on the state change ... * - only 7 bits defined in pmapi.h (so max value is 0x3f)