From 423414937b0d1f13b991d6ae0792e0c576841bfb Mon Sep 17 00:00:00 2001 From: senjan Date: Sun, 26 May 2019 21:20:35 +0200 Subject: does not work within NGZ --- solaris/SolarisProcessList.c | 8 +++++--- solaris/SolarisProcessList.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'solaris') diff --git a/solaris/SolarisProcessList.c b/solaris/SolarisProcessList.c index 2c681852..255f0096 100644 --- a/solaris/SolarisProcessList.c +++ b/solaris/SolarisProcessList.c @@ -25,6 +25,8 @@ in the source distribution for its full text. #define MAXCMDLINE 255 +#define GZONE "global " +#define UZONE "unknown " /*{ #include @@ -62,12 +64,12 @@ typedef struct SolarisProcessList_ { char* SolarisProcessList_readZoneName(kstat_ctl_t* kd, SolarisProcess* sproc) { char* zname; if ( sproc->zoneid == 0 ) { - zname = xStrdup("global "); + zname = xStrdup(GZONE); } else if ( kd == NULL ) { - zname = xStrdup("unknown "); + zname = xStrdup(UZONE); } else { kstat_t* ks = kstat_lookup( kd, "zones", sproc->zoneid, NULL ); - zname = xStrdup(ks->ks_name); + zname = xStrdup(ks == NULL ? UZONE : ks->ks_name); } return zname; } diff --git a/solaris/SolarisProcessList.h b/solaris/SolarisProcessList.h index a5f2fbc2..1729195c 100644 --- a/solaris/SolarisProcessList.h +++ b/solaris/SolarisProcessList.h @@ -12,6 +12,8 @@ in the source distribution for its full text. #define MAXCMDLINE 255 +#define GZONE "global " +#define UZONE "unknown " #include #include -- cgit v1.2.3