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