From cd7c0dd4259bd837972c96d8df83c08edd6dac56 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 12 Mar 2005 06:22:35 +0000 Subject: [PATCH] map mib2 errmsg --- src/os/solaris/sigar_os.h | 2 ++ src/os/solaris/solaris_sigar.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/os/solaris/sigar_os.h b/src/os/solaris/sigar_os.h index 7cfd3993..b4a9aaed 100644 --- a/src/os/solaris/sigar_os.h +++ b/src/os/solaris/sigar_os.h @@ -270,5 +270,7 @@ struct sigar_t { #define HAVE_GETPWNAM_R #define HAVE_GETPWUID_R +#define SIGAR_EMIB2 (SIGAR_OS_START_ERROR+1) + #endif /* SIGAR_OS_H */ diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index 0bb3a441..18dc5e72 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -145,7 +145,12 @@ int sigar_os_close(sigar_t *sigar) char *sigar_os_error_string(sigar_t *sigar, int err) { - return NULL; + switch (err) { + case SIGAR_EMIB2: + return sigar->mib2.errmsg; + default: + return NULL; + } } static SIGAR_INLINE int sigar_kstat_update(sigar_t *sigar) @@ -1499,7 +1504,7 @@ int sigar_net_route_list_get(sigar_t *sigar, } if (rc != GET_MIB2_EOD) { - /*XXX*/ + return SIGAR_EMIB2; } return SIGAR_OK; @@ -1997,7 +2002,7 @@ int sigar_net_connection_list_get(sigar_t *sigar, } if (rc != GET_MIB2_EOD) { - /*XXX*/ + return SIGAR_EMIB2; } return SIGAR_OK;