diff --git a/snapshot/fuchsia/system_snapshot_fuchsia.cc b/snapshot/fuchsia/system_snapshot_fuchsia.cc index d408dff4..c108529b 100644 --- a/snapshot/fuchsia/system_snapshot_fuchsia.cc +++ b/snapshot/fuchsia/system_snapshot_fuchsia.cc @@ -38,10 +38,7 @@ void SystemSnapshotFuchsia::Initialize(const timeval* snapshot_time) { // garnet/bin/uname/uname.c, however, this information isn't provided by // uname(). Additionally, uname() seems to hang if the network is in a bad // state when attempting to retrieve the nodename, so avoid it for now. - char kernel_version[256] = {}; - zx_status_t status = - zx_system_get_version(kernel_version, sizeof(kernel_version)); - ZX_LOG_IF(ERROR, status != ZX_OK, status) << "zx_system_get_version"; + std::string kernel_version = zx_system_get_version_string(); #if defined(ARCH_CPU_X86_64) static constexpr const char kArch[] = "x86_64"; @@ -50,8 +47,8 @@ void SystemSnapshotFuchsia::Initialize(const timeval* snapshot_time) { #else static constexpr const char kArch[] = "unknown"; #endif - os_version_full_ = - base::StringPrintf("Zircon prerelease %s %s", kernel_version, kArch); + os_version_full_ = base::StringPrintf( + "Zircon prerelease %s %s", kernel_version.c_str(), kArch); INITIALIZATION_STATE_SET_VALID(initialized_); }