mirror of https://github.com/Icinga/icinga2.git
parent
222b90107f
commit
bb69540b32
|
@ -123,12 +123,14 @@ void PerfdataWriter::RotateFile(std::ofstream& output, const String& temp_path,
|
||||||
if (output.good()) {
|
if (output.good()) {
|
||||||
output.close();
|
output.close();
|
||||||
|
|
||||||
String finalFile = perfdata_path + "." + Convert::ToString((long)Utility::GetTime());
|
if (Utility::PathExists(temp_path)) {
|
||||||
if (rename(temp_path.CStr(), finalFile.CStr()) < 0) {
|
String finalFile = perfdata_path + "." + Convert::ToString((long)Utility::GetTime());
|
||||||
BOOST_THROW_EXCEPTION(posix_error()
|
if (rename(temp_path.CStr(), finalFile.CStr()) < 0) {
|
||||||
<< boost::errinfo_api_function("rename")
|
BOOST_THROW_EXCEPTION(posix_error()
|
||||||
<< boost::errinfo_errno(errno)
|
<< boost::errinfo_api_function("rename")
|
||||||
<< boost::errinfo_file_name(temp_path));
|
<< boost::errinfo_errno(errno)
|
||||||
|
<< boost::errinfo_file_name(temp_path));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue