From: Vsevolod Stakhov Date: Fri, 11 Nov 2022 21:18:42 +0000 (+0000) Subject: [Minor] Fix build on 32bit platforms X-Git-Tag: 3.5~215 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e0d26115416a146503eb2ae73e2e3d9acf58622a;p=rspamd.git [Minor] Fix build on 32bit platforms --- diff --git a/src/libutil/cxx/file_util.cxx b/src/libutil/cxx/file_util.cxx index e3b3a2605..4536fa97b 100644 --- a/src/libutil/cxx/file_util.cxx +++ b/src/libutil/cxx/file_util.cxx @@ -198,7 +198,7 @@ auto raii_mmaped_file::mmap_shared(raii_file &&file, } /* Update stat on file to ensure it is up-to-date */ file.update_stat(); - map = mmap(nullptr, file.get_size() - offset, flags, MAP_SHARED, file.get_fd(), offset); + map = mmap(nullptr, (std::size_t)(file.get_size() - offset), flags, MAP_SHARED, file.get_fd(), offset); if (map == MAP_FAILED) { return tl::make_unexpected(error { fmt::format("cannot mmap file {}: {}", @@ -206,7 +206,7 @@ auto raii_mmaped_file::mmap_shared(raii_file &&file, } - return raii_mmaped_file{std::move(file), map, file.get_size() - offset}; + return raii_mmaped_file{std::move(file), map, (std::size_t)(file.get_size() - offset)}; } auto raii_mmaped_file::mmap_shared(const char *fname, int open_flags,