diff options
Diffstat (limited to 'src/libutil/cxx/file_util.cxx')
-rw-r--r-- | src/libutil/cxx/file_util.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/cxx/file_util.cxx b/src/libutil/cxx/file_util.cxx index d0860b77b..1993ff666 100644 --- a/src/libutil/cxx/file_util.cxx +++ b/src/libutil/cxx/file_util.cxx @@ -145,6 +145,16 @@ auto raii_file::update_stat() noexcept -> bool 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 { |