From: Otto Moerbeek Date: Tue, 11 Nov 2025 14:40:41 +0000 (+0100) Subject: Fix a bug: some C++ libraries do not use 0 as epoch but a negative number X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=addbabc61701e2dad5d1e6047d4219eaa439dbda;p=thirdparty%2Fpdns.git Fix a bug: some C++ libraries do not use 0 as epoch but a negative number Signed-off-by: Otto Moerbeek --- diff --git a/pdns/recursordist/nod.cc b/pdns/recursordist/nod.cc index 0e661c33e2..e50f4ceee4 100644 --- a/pdns/recursordist/nod.cc +++ b/pdns/recursordist/nod.cc @@ -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())) {