mirror of https://github.com/Icinga/icinga2.git
parent
69bf01155d
commit
e57bf22d82
|
@ -340,10 +340,20 @@ void CompatComponent::StatusTimerHandler(void)
|
|||
}
|
||||
|
||||
statusfp.close();
|
||||
rename(statuspathtmp.CStr(), statuspath.CStr());
|
||||
objectfp.close();
|
||||
|
||||
#ifdef _WIN32
|
||||
_unlink(statuspath.CStr());
|
||||
_unlink(objectspath.CStr());
|
||||
#endif /* _WIN32 */
|
||||
|
||||
statusfp.close();
|
||||
if (rename(statuspathtmp.CStr(), statuspath.CStr()) < 0)
|
||||
throw_exception(PosixException("rename() failed", errno));
|
||||
|
||||
objectfp.close();
|
||||
rename(objectspathtmp.CStr(), objectspath.CStr());
|
||||
if (rename(objectspathtmp.CStr(), objectspath.CStr()) < 0)
|
||||
throw_exception(PosixException("rename() failed", errno));
|
||||
}
|
||||
|
||||
EXPORT_COMPONENT(compat, CompatComponent);
|
||||
|
|
|
@ -416,6 +416,12 @@ void DynamicObject::DumpObjects(const String& filename)
|
|||
}
|
||||
}
|
||||
|
||||
fp.close();
|
||||
|
||||
#ifdef _WIN32
|
||||
_unlink(filename.CStr());
|
||||
#endif /* _WIN32 */
|
||||
|
||||
if (rename(tempFilename.CStr(), filename.CStr()) < 0)
|
||||
throw_exception(PosixException("rename() failed", errno));
|
||||
}
|
||||
|
|
|
@ -116,6 +116,10 @@ void Object::PrintMemoryProfile(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
_unlink("dictionaries.dump");
|
||||
#endif /* _WIN32 */
|
||||
|
||||
dictfp.close();
|
||||
if (rename("dictionaries.dump.tmp", "dictionaries.dump") < 0)
|
||||
throw_exception(PosixException("rename() failed", errno));
|
||||
|
|
Loading…
Reference in New Issue