From 66c0b19ed6fec2afd4ed381665274fa83c67660e Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Fri, 1 Sep 2023 09:34:46 +1000 Subject: Correct pid_t type return from Platform_getMaxPid function Coverity scanning shows we end up passing an integer into the Row_setPidColumnWidth routine which requires a pid_t - update each platform to return the correct type (and never return -1 as a failure code, this was being ignored). --- unsupported/Platform.c | 4 ++-- unsupported/Platform.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'unsupported') diff --git a/unsupported/Platform.c b/unsupported/Platform.c index df7f3600..dbfddd91 100644 --- a/unsupported/Platform.c +++ b/unsupported/Platform.c @@ -102,8 +102,8 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { *fifteen = 0; } -int Platform_getMaxPid(void) { - return 1; +pid_t Platform_getMaxPid(void) { + return INT_MAX; } double Platform_setCPUValues(Meter* this, unsigned int cpu) { diff --git a/unsupported/Platform.h b/unsupported/Platform.h index 8e08dc23..c4cd06a0 100644 --- a/unsupported/Platform.h +++ b/unsupported/Platform.h @@ -8,6 +8,9 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include +#include + #include "Action.h" #include "BatteryMeter.h" #include "DiskIOMeter.h" @@ -40,7 +43,7 @@ int Platform_getUptime(void); void Platform_getLoadAverage(double* one, double* five, double* fifteen); -int Platform_getMaxPid(void); +pid_t Platform_getMaxPid(void); double Platform_setCPUValues(Meter* this, unsigned int cpu); -- cgit v1.2.3