void-packages/srcpkgs/chromium/patches/fix-resolver-musl.patch

67 lines
2.5 KiB
Diff

--- a/net/dns/public/scoped_res_state.cc.orig
+++ b/net/dns/public/scoped_res_state.cc
@@ -13,7 +13,7 @@
namespace net {
ScopedResState::ScopedResState() {
-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
+#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
// Note: res_ninit in glibc always returns 0 and sets RES_INIT.
// res_init behaves the same way.
memset(&_res, 0, sizeof(_res));
--- a/net/dns/public/scoped_res_state.cc
+++ b/net/dns/public/scoped_res_state.cc
@@ -25,7 +25,7 @@
}
ScopedResState::~ScopedResState() {
-#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
+#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
// Prefer res_ndestroy where available.
#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
@@ -34,7 +34,7 @@
res_nclose(&res_);
#endif // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
-#endif // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
+#endif // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
}
bool ScopedResState::IsValid() const {
--- a/net/dns/host_resolver_system_task.cc.orig
+++ b/net/dns/host_resolver_system_task.cc
@@ -311,7 +311,7 @@
void EnsureSystemHostResolverCallReady() {
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
- !BUILDFLAG(IS_ANDROID)
+ !BUILDFLAG(IS_ANDROID) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
EnsureDnsReloaderInit();
#elif BUILDFLAG(IS_WIN)
EnsureWinsockInit();
--- a/net/dns/dns_reloader.cc.orig
+++ b/net/dns/dns_reloader.cc
@@ -7,7 +7,8 @@
#include "build/build_config.h"
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
- !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
+ !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && \
+ !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
#include <resolv.h>
--- a/net/dns/host_resolver_system_task.cc
+++ b/net/dns/host_resolver_system_task.cc
@@ -397,7 +397,8 @@
base::BlockingType::WILL_BLOCK);
#if BUILDFLAG(IS_POSIX) && \
- !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
+ !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID) || \
+ (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__)))
DnsReloaderMaybeReload();
#endif
auto [ai, err, os_error] = AddressInfo::Get(host, hints, nullptr, network);