summaryrefslogtreecommitdiffstats
path: root/solaris/SolarisProcessList.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-02-17 17:38:35 +0100
committerBenny Baumann <BenBE@geshi.org>2021-03-19 23:30:54 +0100
commita11d01568c5e7bc5570fd48fa0703d837c4bcd84 (patch)
tree3e298e81123789ed6ae288e5bd32e91ebfb3ff01 /solaris/SolarisProcessList.c
parent53bcc5cbffbdd69e0e08bd33c5e357dd5b753456 (diff)
Use unsigned types for CPU counts and associated variables
Diffstat (limited to 'solaris/SolarisProcessList.c')
-rw-r--r--solaris/SolarisProcessList.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/solaris/SolarisProcessList.c b/solaris/SolarisProcessList.c
index 1f24c9ab..5223addf 100644
--- a/solaris/SolarisProcessList.c
+++ b/solaris/SolarisProcessList.c
@@ -69,7 +69,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, ui
static inline void SolarisProcessList_scanCPUTime(ProcessList* pl) {
const SolarisProcessList* spl = (SolarisProcessList*) pl;
- int cpus = pl->cpuCount;
+ unsigned int cpus = pl->cpuCount;
kstat_t* cpuinfo = NULL;
kstat_named_t* idletime = NULL;
kstat_named_t* intrtime = NULL;
@@ -91,7 +91,7 @@ static inline void SolarisProcessList_scanCPUTime(ProcessList* pl) {
}
// Calculate per-CPU statistics first
- for (int i = 0; i < cpus; i++) {
+ for (unsigned int i = 0; i < cpus; i++) {
if (spl->kd != NULL) {
if ((cpuinfo = kstat_lookup(spl->kd, "cpu", i, "sys")) != NULL) {
if (kstat_read(spl->kd, cpuinfo, NULL) != -1) {

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