0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-14 00:34:18 +01:00

ircd:Ⓜ️:events: Open dump file w/ exclusive option; prevent overwrite.

This commit is contained in:
Jason Volk 2020-09-28 21:35:11 -07:00
parent 4dbb550e89
commit 1bb6c2dcd0

View file

@ -87,18 +87,19 @@ ircd::m::events::rebuild()
void
ircd::m::events::dump__file(const string_view &filename)
{
static const fs::fd::opts fileopts
{
std::ios::out | std::ios::app
};
static const db::gopts gopts
{
db::get::NO_CACHE, db::get::NO_CHECKSUM
};
static const fs::fd::opts fileopts
{
std::ios::out
};
auto _fileopts(fileopts);
_fileopts.dontneed = true;
_fileopts.exclusive = true; // error if exists
_fileopts.dontneed = true; // fadvise
const fs::fd file
{
filename, _fileopts