mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 20:24:33 +02:00
parent
9687e27c38
commit
0e76876228
@ -123,6 +123,7 @@ void PerfdataWriter::RotateFile(std::ofstream& output, const String& temp_path,
|
||||
if (output.good()) {
|
||||
output.close();
|
||||
|
||||
if (Utility::PathExists(temp_path)) {
|
||||
String finalFile = perfdata_path + "." + Convert::ToString((long)Utility::GetTime());
|
||||
if (rename(temp_path.CStr(), finalFile.CStr()) < 0) {
|
||||
BOOST_THROW_EXCEPTION(posix_error()
|
||||
@ -131,6 +132,7 @@ void PerfdataWriter::RotateFile(std::ofstream& output, const String& temp_path,
|
||||
<< boost::errinfo_file_name(temp_path));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output.open(temp_path.CStr());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user