Skip to content

Commit

Permalink
report: split up osVersion and machine values
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cjihrig committed Jan 30, 2019
1 parent 5aa89d6 commit c233546
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c233546

Please sign in to comment.