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:
parent
4dbb550e89
commit
1bb6c2dcd0
1 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue