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). --- linux/Platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'linux/Platform.c') diff --git a/linux/Platform.c b/linux/Platform.c index 33bd8ced..325f92ed 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -291,12 +291,12 @@ err: *fifteen = NAN; } -int Platform_getMaxPid(void) { +pid_t Platform_getMaxPid(void) { + pid_t maxPid = 4194303; FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r"); if (!file) - return -1; + return maxPid; - int maxPid = 4194303; int match = fscanf(file, "%32d", &maxPid); (void) match; fclose(file); -- cgit v1.2.3