Skip to content

Commit cc22fd7

Browse files
cjihrigaddaleax
authored andcommitted
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: #25755 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 99bc0df commit cc22fd7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/node_report.cc

+5-7
Original file line numberDiff line numberDiff line change
@@ -426,22 +426,20 @@ static void PrintVersionInformation(JSONWriter* writer) {
426426
if (uname(&os_info) >= 0) {
427427
#ifdef _AIX
428428
buf << os_info.sysname << " " << os_info.version << "." << os_info.release;
429-
writer->json_keyvalue("osVersion", buf.str());
430-
buf.flush();
431429
#else
432430
buf << os_info.sysname << " " << os_info.release << " " << os_info.version;
431+
#endif /* _AIX */
433432
writer->json_keyvalue("osVersion", buf.str());
434-
buf.flush();
435-
#endif
433+
buf.str("");
434+
buf << os_info.nodename << " " << os_info.machine;
435+
writer->json_keyvalue("machine", buf.str());
436+
436437
const char* (*libc_version)();
437438
*(reinterpret_cast<void**>(&libc_version)) =
438439
dlsym(RTLD_DEFAULT, "gnu_get_libc_version");
439440
if (libc_version != nullptr) {
440441
writer->json_keyvalue("glibc", (*libc_version)());
441442
}
442-
buf << os_info.nodename << " " << os_info.machine;
443-
writer->json_keyvalue("machine", buf.str());
444-
buf.flush();
445443
}
446444
#endif
447445
}

0 commit comments

Comments
 (0)