fixup freebsd vendor_version and vendor_code_name

This commit is contained in:
Doug MacEachern 2006-09-30 17:27:10 +00:00
parent 66844ca1d8
commit aa4af2806f
1 changed files with 10 additions and 2 deletions

View File

@ -2235,17 +2235,25 @@ int sigar_os_sys_info_get(sigar_t *sigar,
"%s %s",
sysinfo->vendor_name, sysinfo->vendor_code_name);
#else
#endif
char *ptr;
SIGAR_SSTRCPY(sysinfo->name, "FreeBSD");
SIGAR_SSTRCPY(sysinfo->vendor_name, sysinfo->name);
SIGAR_SSTRCPY(sysinfo->vendor, sysinfo->name);
SIGAR_SSTRCPY(sysinfo->vendor_version,
sysinfo->version);
if ((ptr = strstr(sysinfo->vendor_version, "-"))) {
/* STABLE, RELEASE, CURRENT */
*ptr++ = '\0';
SIGAR_SSTRCPY(sysinfo->vendor_code_name, ptr);
}
snprintf(sysinfo->description,
sizeof(sysinfo->description),
"%s %s",
sysinfo->name, sysinfo->vendor_version);
sysinfo->name, sysinfo->version);
#endif
return SIGAR_OK;
}