diff options
author | Nathan Scott <natoscott@users.noreply.github.com> | 2021-08-17 15:42:33 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-17 15:42:33 +1000 |
commit | 3f727d4720c8df38789dea246a5217a5412ebbcf (patch) | |
tree | 0b7093afd5d7846f86b1e317c0022130ca66e42e /pcp/Platform.c | |
parent | fefff80631e86f0296a2621a3699b16de60b86c6 (diff) | |
parent | d5ff5c48a889c1eab6e3792d3f5ca1566cf05491 (diff) |
Merge pull request #747 from natoscott/coverity
Coverity scan updates (minor)
Diffstat (limited to 'pcp/Platform.c')
-rw-r--r-- | pcp/Platform.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pcp/Platform.c b/pcp/Platform.c index 97788569..d5a76b55 100644 --- a/pcp/Platform.c +++ b/pcp/Platform.c @@ -396,15 +396,15 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { } } -int Platform_getMaxCPU(void) { +unsigned int Platform_getMaxCPU(void) { if (pcp->ncpu) return pcp->ncpu; pmAtomValue value; - if (PCPMetric_values(PCP_HINV_NCPU, &value, 1, PM_TYPE_32) != NULL) - pcp->ncpu = value.l; + if (PCPMetric_values(PCP_HINV_NCPU, &value, 1, PM_TYPE_U32) != NULL) + pcp->ncpu = value.ul; else - pcp->ncpu = -1; + pcp->ncpu = 1; return pcp->ncpu; } |