mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 04:34:43 +02:00
parent
69bf01155d
commit
e57bf22d82
@ -340,10 +340,20 @@ void CompatComponent::StatusTimerHandler(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
statusfp.close();
|
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();
|
objectfp.close();
|
||||||
rename(objectspathtmp.CStr(), objectspath.CStr());
|
if (rename(objectspathtmp.CStr(), objectspath.CStr()) < 0)
|
||||||
|
throw_exception(PosixException("rename() failed", errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_COMPONENT(compat, CompatComponent);
|
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)
|
if (rename(tempFilename.CStr(), filename.CStr()) < 0)
|
||||||
throw_exception(PosixException("rename() failed", errno));
|
throw_exception(PosixException("rename() failed", errno));
|
||||||
}
|
}
|
||||||
|
@ -116,6 +116,10 @@ void Object::PrintMemoryProfile(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
_unlink("dictionaries.dump");
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
dictfp.close();
|
dictfp.close();
|
||||||
if (rename("dictionaries.dump.tmp", "dictionaries.dump") < 0)
|
if (rename("dictionaries.dump.tmp", "dictionaries.dump") < 0)
|
||||||
throw_exception(PosixException("rename() failed", errno));
|
throw_exception(PosixException("rename() failed", errno));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user