mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
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 + "'");
|
Logger::Write(LogInformation, "base", "Dumping program state to file '" + filename + "'");
|
||||||
|
|
||||||
|
String tempFilename = filename + ".tmp";
|
||||||
|
|
||||||
ofstream fp;
|
ofstream fp;
|
||||||
fp.open(filename.CStr());
|
fp.open(tempFilename.CStr());
|
||||||
|
|
||||||
if (!fp)
|
if (!fp)
|
||||||
throw_exception(runtime_error("Could not open '" + filename + "' file"));
|
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)
|
void DynamicObject::RestoreObjects(const String& filename)
|
||||||
|
@ -208,9 +208,7 @@ int IcingaApplication::Main(const vector<String>& args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IcingaApplication::DumpProgramState(void) {
|
void IcingaApplication::DumpProgramState(void) {
|
||||||
String temp = GetStatePath() + ".tmp";
|
DynamicObject::DumpObjects(GetStatePath());
|
||||||
DynamicObject::DumpObjects(temp);
|
|
||||||
rename(temp.CStr(), GetStatePath().CStr());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IcingaApplication::Ptr IcingaApplication::GetInstance(void)
|
IcingaApplication::Ptr IcingaApplication::GetInstance(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user