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 <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
cjihrig authored and Anna Henningsen committed 2019-01-31 00:00:06 +01:00
1 parent 99bc0df74c
commit cc22fd7be9
1 file changed
+5 -7
+5 -7
View File
@@ -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<void**>(&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
}