mirror of https://github.com/Icinga/icinga2.git
Fixed log message incorrectly referring to temp file.
This commit is contained in:
parent
21ea872651
commit
3c2acab7d7
|
@ -352,8 +352,10 @@ void DynamicObject::DumpObjects(const String& filename)
|
|||
{
|
||||
Logger::Write(LogInformation, "base", "Dumping program state to file '" + filename + "'");
|
||||
|
||||
String tempFilename = filename + ".tmp";
|
||||
|
||||
ofstream fp;
|
||||
fp.open(filename.CStr());
|
||||
fp.open(tempFilename.CStr());
|
||||
|
||||
if (!fp)
|
||||
throw_exception(runtime_error("Could not open '" + filename + "' file"));
|
||||
|
@ -403,6 +405,8 @@ void DynamicObject::DumpObjects(const String& filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
rename(tempFilename.CStr(), filename.CStr());
|
||||
}
|
||||
|
||||
void DynamicObject::RestoreObjects(const String& filename)
|
||||
|
|
|
@ -208,9 +208,7 @@ int IcingaApplication::Main(const vector<String>& args)
|
|||
}
|
||||
|
||||
void IcingaApplication::DumpProgramState(void) {
|
||||
String temp = GetStatePath() + ".tmp";
|
||||
DynamicObject::DumpObjects(temp);
|
||||
rename(temp.CStr(), GetStatePath().CStr());
|
||||
DynamicObject::DumpObjects(GetStatePath());
|
||||
}
|
||||
|
||||
IcingaApplication::Ptr IcingaApplication::GetInstance(void)
|
||||
|
|
Loading…
Reference in New Issue