Skip to content

Commit

Permalink
Properly handle FreeBSD clock.
Browse files Browse the repository at this point in the history
  • Loading branch information
dreibh committed Sep 17, 2024
1 parent 78fff8c commit e364e5c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/resultswriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,23 @@ bool ResultsWriter::changeFile(const bool createNewFile)
default:
break;
}
const std::string name = UniqueID + str(boost::format("-%09d.results%s") % SeqNumber % extension);
const std::string name = UniqueID +
str(boost::format("-%09d.results%s") % SeqNumber % extension);
std::filesystem::path targetPath =
Directory /
makeDirectoryHierarchy<ResultTimePoint>(std::filesystem::path(),
name, ResultClock::now(),
0, TimestampDepth);
makeDirectoryHierarchy<std::chrono::system_clock::time_point>(
std::filesystem::path(),
name, std::chrono::system_clock::now(),
0, TimestampDepth);
TargetFileName = targetPath / name;
TempFileName = TargetFileName;
TempFileName += ".tmp";
try {
std::filesystem::create_directories(targetPath);
}
catch(std::filesystem::filesystem_error& e) {
HPCT_LOG(warning) << "Creating directory hierarchy " << targetPath << " failed: " << e.what();
HPCT_LOG(warning) << "Creating directory hierarchy " << targetPath
<< " failed: " << e.what();
return false;
}
OutputFile.open(TempFileName.c_str(), std::ios_base::out | std::ios_base::binary);
Expand Down

0 comments on commit e364e5c

Please sign in to comment.