0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 10:08:56 +02:00

ircd::gpt::model: Improve cache open mode related.

This commit is contained in:
Jason Volk 2021-09-15 02:28:22 -07:00
parent 5d837f9e87
commit 9ca95591ff

View file

@ -185,14 +185,21 @@ ircd::gpt::model::init_from_cache(const string_view &cache_path)
sizeof(model::decoder),
};
const auto mode
{
cache_shared?
std::ios::in | std::ios::out:
std::ios::in
};
const fs::fd fd
{
cache_path, std::ios::in //| std::ios::out
cache_path, mode
};
fs::map::opts map_opts
{
std::ios::in | std::ios::out
mode
};
map_opts.locked = bool(cache_locked);