summaryrefslogtreecommitdiffstats
path: root/linux/Platform.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2023-09-01 09:34:46 +1000
committerNathan Scott <nathans@redhat.com>2023-09-04 08:59:41 +1000
commit66c0b19ed6fec2afd4ed381665274fa83c67660e (patch)
treee8420e98aa4d5fb633cbb432babfa86d3dcdaf37 /linux/Platform.c
parent9392e1d596dd2bed165c8cb522a0c9fd5fede66d (diff)
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).
Diffstat (limited to 'linux/Platform.c')
-rw-r--r--linux/Platform.c6
1 files changed, 3 insertions, 3 deletions
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);

© 2014-2024 Faster IT GmbH | imprint | privacy policy