set sys_info vendor_version and description

This commit is contained in:
Doug MacEachern 2006-09-25 01:22:00 +00:00
parent b56465027f
commit 6a47deb2bb
1 changed files with 19 additions and 0 deletions

View File

@ -2297,8 +2297,27 @@ int sigar_proc_port_get(sigar_t *sigar, int protocol,
int sigar_os_sys_info_get(sigar_t *sigar, int sigar_os_sys_info_get(sigar_t *sigar,
sigar_sys_info_t *sysinfo) sigar_sys_info_t *sysinfo)
{ {
char *vendor_version;
SIGAR_SSTRCPY(sysinfo->name, "Solaris"); SIGAR_SSTRCPY(sysinfo->name, "Solaris");
SIGAR_SSTRCPY(sysinfo->vendor, "Sun Microsystems"); SIGAR_SSTRCPY(sysinfo->vendor, "Sun Microsystems");
if (strEQ(sysinfo->version, "5.6")) {
vendor_version = "2.6";
}
else {
if ((vendor_version = strchr(sysinfo->version, '.'))) {
++vendor_version;
}
else {
vendor_version = sysinfo->version;
}
}
SIGAR_SSTRCPY(sysinfo->vendor_version, vendor_version);
sprintf(sysinfo->description, "%s %s",
sysinfo->name, sysinfo->vendor_version);
return SIGAR_OK; return SIGAR_OK;
} }