From 493fa0d530c1f17db64d905c04b8f82d36d38eec Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 20 Aug 2026 17:40:55 +0000 Subject: [PATCH] Revert "Use log_func, not fprintf, in massdns" --- libnetutil/massdns.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libnetutil/massdns.cc b/libnetutil/massdns.cc index 67471939c..722f8fff4 100644 --- a/libnetutil/massdns.cc +++ b/libnetutil/massdns.cc @@ -1596,8 +1596,12 @@ void DNS::ResolverImpl::etchosts_init(void) { char tpbuf[2048]; int has_backslash; - if (!GetWindowsDirectoryA(windows_dir, sizeof(windows_dir))) - log_func(0, "massdns: Failed to determine your windows directory\n"); + // Can't use log_func() in a static class function, since it is not defined. + // Use fprintf instead. + if (!GetWindowsDirectoryA(windows_dir, sizeof(windows_dir))) { + fprintf(stderr, "massdns: Failed to determine your windows directory\n"); + return; + } // If it has a backslash it's C:\, otherwise something like C:\WINNT has_backslash = (windows_dir[strlen(windows_dir)-1] == '\\');