return fstat(fd, &st) != -1;
}
+raii_file::raii_file(const char *fname, int fd, bool temp) : fd(fd), temp(temp)
+{
+ std::size_t nsz;
+
+ /* Normalize path */
+ this->fname = fname;
+ rspamd_normalize_path_inplace(this->fname.data(), this->fname.size(), &nsz);
+ this->fname.resize(nsz);
+}
+
raii_locked_file::~raii_locked_file() noexcept
{
std::string fname;
struct stat st;
- explicit raii_file(const char *fname, int fd, bool temp) : fd(fd), temp(temp), fname(fname) {}
+ explicit raii_file(const char *fname, int fd, bool temp);
};
/**
* A simple RAII object to contain a file descriptor with an flock wrap