aboutsummaryrefslogtreecommitdiffstats
path: root/lib/os_mon/c_src/cpu_sup.c
diff options
context:
space:
mode:
authorSimon Cornish <[email protected]>2013-09-02 23:31:52 -0700
committerSimon Cornish <[email protected]>2013-09-02 23:31:52 -0700
commitefbd406f1b8f148569a40a090c38929a7661d2aa (patch)
treec889ff72011133f71f56a56c981988c74250f7ae /lib/os_mon/c_src/cpu_sup.c
parent8be8c20d33d67acb205a51897ea5284bc81605e7 (diff)
downloadotp-efbd406f1b8f148569a40a090c38929a7661d2aa.tar.gz
otp-efbd406f1b8f148569a40a090c38929a7661d2aa.tar.bz2
otp-efbd406f1b8f148569a40a090c38929a7661d2aa.zip
Fix broken cpu_sup:nprocs and others on Solaris 64-bit
The correct kstat datatype for nproc & avenrun_* is ui32, not ulong. Under 64-bit OTP builds garbage was returned because the wrong datatype was used. This patch correcs the datatype. It also adds an additional check in the test case for a slightly less insane return value.
Diffstat (limited to 'lib/os_mon/c_src/cpu_sup.c')
-rw-r--r--lib/os_mon/c_src/cpu_sup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/os_mon/c_src/cpu_sup.c b/lib/os_mon/c_src/cpu_sup.c
index 22946eca0e..e9fd75a32c 100644
--- a/lib/os_mon/c_src/cpu_sup.c
+++ b/lib/os_mon/c_src/cpu_sup.c
@@ -293,10 +293,10 @@ static unsigned int misc_measure(char* name) {
if(!entry)
return -1;
- if(entry->data_type != KSTAT_DATA_ULONG)
+ if(entry->data_type != KSTAT_DATA_UINT32)
return -1;
- return entry->value.ul;
+ return entry->value.ui32;
}