diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-01-17 20:05:45 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-01-18 14:12:51 -0800 |
commit | 4a54dee95260d36d0c8b5f8a35ac905f36b36f17 (patch) | |
tree | 89ac465381706dec4635b24985176d68e5424355 /get_load.c | |
parent | 1918be9695e0e912cb536373dd3da385473ab9e5 (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>
Diffstat (limited to 'get_load.c')
-rw-r--r-- | get_load.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 */ |