aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2012-10-25 17:15:49 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-30 14:11:24 -0400
commitf426a36cecfea2cfd69c28ca5ba4f4bfae913f63 (patch)
treef5e6cf3132c8201313bfeb8dc1c69d96cbdf1c70 /tools
parente64de3b96c1ba3c1de236a4a103ec21234a5849f (diff)
tools: hv: Return the full kernel version
Currently, we are returning the same string for both OSBuildNumber and OSVersion keys. Return the full uts string for the OSBuild key since Windows does not impose any restrictions on this. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reported-by: Claudio Latini <claudio.latini@live.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/hv/hv_kvp_daemon.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 5959affd8820..6c7bcb9932cb 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -88,6 +88,7 @@ static char *os_major = "";
88static char *os_minor = ""; 88static char *os_minor = "";
89static char *processor_arch; 89static char *processor_arch;
90static char *os_build; 90static char *os_build;
91static char *os_version;
91static char *lic_version = "Unknown version"; 92static char *lic_version = "Unknown version";
92static struct utsname uts_buf; 93static struct utsname uts_buf;
93 94
@@ -453,7 +454,9 @@ void kvp_get_os_info(void)
453 char *p, buf[512]; 454 char *p, buf[512];
454 455
455 uname(&uts_buf); 456 uname(&uts_buf);
456 os_build = uts_buf.release; 457 os_version = uts_buf.release;
458 os_build = strdup(uts_buf.release);
459
457 os_name = uts_buf.sysname; 460 os_name = uts_buf.sysname;
458 processor_arch = uts_buf.machine; 461 processor_arch = uts_buf.machine;
459 462
@@ -462,7 +465,7 @@ void kvp_get_os_info(void)
462 * string to be of the form: x.y.z 465 * string to be of the form: x.y.z
463 * Strip additional information we may have. 466 * Strip additional information we may have.
464 */ 467 */
465 p = strchr(os_build, '-'); 468 p = strchr(os_version, '-');
466 if (p) 469 if (p)
467 *p = '\0'; 470 *p = '\0';
468 471
@@ -1649,7 +1652,7 @@ int main(void)
1649 strcpy(key_name, "OSMinorVersion"); 1652 strcpy(key_name, "OSMinorVersion");
1650 break; 1653 break;
1651 case OSVersion: 1654 case OSVersion:
1652 strcpy(key_value, os_build); 1655 strcpy(key_value, os_version);
1653 strcpy(key_name, "OSVersion"); 1656 strcpy(key_name, "OSVersion");
1654 break; 1657 break;
1655 case ProcessorArchitecture: 1658 case ProcessorArchitecture: