summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-01-17 20:05:45 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-01-18 14:12:51 -0800
commit4a54dee95260d36d0c8b5f8a35ac905f36b36f17 (patch)
tree89ac465381706dec4635b24985176d68e5424355
parent1918be9695e0e912cb536373dd3da385473ab9e5 (diff)
Solaris: Read avenrun_1min kstat as a uint32, not a long
Fixes garbage data & crashes when built as a 64-bit binary on Solaris SPARC, since the high 32-bits was being filled with randomness. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Arvind Umrao <arvind.umrao@oracle.com> Reviewed-by: Jay Cotton <jay.cotton@oracle.com>
-rw-r--r--get_load.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/get_load.c b/get_load.c
index 0828350..185a7fb 100644
--- a/get_load.c
+++ b/get_load.c
@@ -641,7 +641,7 @@ GetLoadPoint(Widget w, XtPointer closure, XtPointer call_data)
if ((vp = kstat_data_lookup(ksp, "avenrun_1min")) == NULL)
xload_error("kstat_data_lookup failed:", strerror(errno));
- *loadavg = (double)vp->value.l / FSCALE;
+ *loadavg = (double)vp->value.ui32 / FSCALE;
}
#else /* not Solaris */