handle errors reading header better
This commit is contained in:
@@ -93,10 +93,10 @@ GpuMetricsHeader_t getGpuMetricsRev(std::string path) {
|
||||
std::ifstream f(path, std::ios::binary);
|
||||
if (f.good()) {
|
||||
f.read(reinterpret_cast<char *>(&header), sizeof(header));
|
||||
std::cout << "[GpuMetrics] Read GpuMetrics format v" << std::to_string(header.format_revision) << "_" << std::to_string(header.content_revision);
|
||||
std::cout << ", size " << std::to_string(header.structure_size) << std::endl;
|
||||
std::cout << "[GpuMetrics] Read GpuMetrics format v" << std::to_string(header.format_revision) << "_" << std::to_string(header.content_revision) << std::endl;
|
||||
} else {
|
||||
std::cerr << "[GpuMetrics] Error reading gpu metrics header" << std::endl;
|
||||
header.structure_size = 0;
|
||||
}
|
||||
return header;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user