From cc22fd7be940b15cee6432abbb9ae9094f47ea8d Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 28 Jan 2019 00:14:40 -0500 Subject: [PATCH] report: split up osVersion and machine values Prior to this commit, on non-Windows platforms, the "osVersion" value was prepended to the "machine" value. PR-URL: https://github.com/nodejs/node/pull/25755 Reviewed-By: Gireesh Punathil Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Richard Lau --- src/node_report.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/node_report.cc b/src/node_report.cc index 4caa01d3cfbe2f..69ae0ee53eb292 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -426,22 +426,20 @@ static void PrintVersionInformation(JSONWriter* writer) { if (uname(&os_info) >= 0) { #ifdef _AIX buf << os_info.sysname << " " << os_info.version << "." << os_info.release; - writer->json_keyvalue("osVersion", buf.str()); - buf.flush(); #else buf << os_info.sysname << " " << os_info.release << " " << os_info.version; +#endif /* _AIX */ writer->json_keyvalue("osVersion", buf.str()); - buf.flush(); -#endif + buf.str(""); + buf << os_info.nodename << " " << os_info.machine; + writer->json_keyvalue("machine", buf.str()); + const char* (*libc_version)(); *(reinterpret_cast(&libc_version)) = dlsym(RTLD_DEFAULT, "gnu_get_libc_version"); if (libc_version != nullptr) { writer->json_keyvalue("glibc", (*libc_version)()); } - buf << os_info.nodename << " " << os_info.machine; - writer->json_keyvalue("machine", buf.str()); - buf.flush(); } #endif }