summaryrefslogtreecommitdiffstats
path: root/netbsd
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 /netbsd
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 'netbsd')
-rw-r--r--netbsd/Platform.c2
-rw-r--r--netbsd/Platform.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/netbsd/Platform.c b/netbsd/Platform.c
index 1d6509ff..8231cdfd 100644
--- a/netbsd/Platform.c
+++ b/netbsd/Platform.c
@@ -229,7 +229,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
*fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale;
}
-int Platform_getMaxPid(void) {
+pid_t Platform_getMaxPid(void) {
// https://nxr.netbsd.org/xref/src/sys/sys/ansi.h#__pid_t
// pid is assigned as a 32bit Integer.
return INT32_MAX;
diff --git a/netbsd/Platform.h b/netbsd/Platform.h
index ae34198c..a543f52d 100644
--- a/netbsd/Platform.h
+++ b/netbsd/Platform.h
@@ -55,7 +55,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, int cpu);

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