bool symcache::save_items() const
{
+ if (cfg->cache_filename == nullptr) {
+ return false;
+ }
+
auto file_sink = util::raii_file_sink::create(cfg->cache_filename,
O_WRONLY | O_TRUNC, 00644);
auto raii_file_sink::create(const char *fname, int flags, int perms,
const char *suffix) -> tl::expected<raii_file_sink, std::string>
{
+ if (!fname || !suffix) {
+ return tl::make_unexpected("cannot create file sink: bad input arguments");
+ }
+
auto tmp_fname = fmt::format("{}.{}", fname, suffix);
auto file = raii_locked_file::create(tmp_fname.c_str(), flags, perms);