]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix a bug: some C++ libraries do not use 0 as epoch but a negative number
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 11 Nov 2025 14:40:41 +0000 (15:40 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 2 Jun 2026 13:40:58 +0000 (15:40 +0200)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/nod.cc

index 0e661c33e29f8fde2b2552b04d8a345990f60b04..e50f4ceee43ceb53a30b819891eaa176f0148ffb 100644 (file)
@@ -63,7 +63,8 @@ bool PersistentSBF::init(bool ignore_pid)
       if (filesystem::exists(path) && filesystem::is_directory(path)) {
         remove_tmp_files(path, lock);
         filesystem::path newest_file;
-        filesystem::file_time_type newest_time{};
+        // Tricky business, some C++ libs do not use 0 as epoch!
+        filesystem::file_time_type newest_time{filesystem::file_time_type::min()};
         Regex file_regex(d_prefix + ".*\\." + bf_suffix + "$");
         for (const auto& file : filesystem::directory_iterator(path)) {
           if (filesystem::is_regular_file(file.path()) && file_regex.match(file.path().filename().c_str())) {