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 <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>
  • Loading branch information
cjihrig authored and addaleax committed Jan 30, 2019
1 parent 99bc0df commit cc22fd7
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 cc22fd7

Please sign in to comment.