summaryrefslogtreecommitdiffstats
path: root/solaris
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2020-08-20 14:09:27 +1000
committerNathan Scott <nathans@redhat.com>2020-08-20 14:09:27 +1000
commitb30c22d687e692fb2a16ce50d491f3d724301af5 (patch)
treefa7cbe3534753e4628f0eb4bf4c36d1a39c870e0 /solaris
parent42c8e47cd6a8b87d4a30109d31b9c1427edfe9cd (diff)
parent01a1cc063f6bc5dd5b33d29013301073e3e159e9 (diff)
Merge branch 'hishamhm-pull-914'
Diffstat (limited to 'solaris')
-rw-r--r--solaris/SolarisProcessList.c8
-rw-r--r--solaris/SolarisProcessList.h2
2 files changed, 7 insertions, 3 deletions
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 <kstat.h>
@@ -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 <kstat.h>
#include <sys/param.h>

© 2014-2024 Faster IT GmbH | imprint | privacy policy