From 10e8d8804f9e1e38892aee522c3a4aa6824ab359 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 10 Oct 2006 01:00:22 +0000 Subject: [PATCH] use KSTAT_NAMED_STR_PTR if available --- src/os/solaris/solaris_sigar.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index 99265f9e..8d5b0bcd 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -246,6 +246,11 @@ int sigar_swap_get(sigar_t *sigar, sigar_swap_t *swap) return SIGAR_OK; } +#ifndef KSTAT_NAMED_STR_PTR +/* same offset as KSTAT_NAMED_STR_PTR(brand) */ +#define KSTAT_NAMED_STR_PTR(n) (char *)((n)->value.i32) +#endif + static int get_chip_brand(sigar_t *sigar, int processor, sigar_cpu_info_t *info) { @@ -261,8 +266,8 @@ static int get_chip_brand(sigar_t *sigar, int processor, (kstat_read(sigar->kc, ksp, NULL) != -1) && (brand = (kstat_named_t *)kstat_data_lookup(ksp, "brand"))) { - /* same offset as KSTAT_NAMED_STR_PTR(brand) */ - char *name = (char *)brand->value.i32; + char *name = KSTAT_NAMED_STR_PTR(brand); + char *vendor = "Sun"; char *vendors[] = { "Intel", "AMD", NULL