aboutsummaryrefslogtreecommitdiff
blob: 0931a2d30f3c745636292b23b03417463d906d55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
https://git.alpinelinux.org/aports/tree/testing/qt6-qtwebengine/0004-qt-musl-resolve.patch

--- a/src/3rdparty/chromium/net/dns/public/scoped_res_state.cc
+++ b/src/3rdparty/chromium/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) || defined(_GNU_SOURCE)
   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
   // res_init behaves the same way.
   memset(&_res, 0, sizeof(_res));
@@ -25,16 +25,8 @@
 }
 
 ScopedResState::~ScopedResState() {
-#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
-
-  // Prefer res_ndestroy where available.
-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
-  res_ndestroy(&res_);
-#else
-  res_nclose(&res_);
-#endif  // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
-
-#endif  // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
+  // musl res_init() doesn't actually do anything
+  // no destruction is necessary as no memory has been allocated
 }
 
 bool ScopedResState::IsValid() const {
--- a/src/3rdparty/chromium/net/dns/dns_reloader.cc
+++ b/src/3rdparty/chromium/net/dns/dns_reloader.cc
@@ -6,8 +6,7 @@
 
 #include "build/build_config.h"
 
-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
-    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
+#if defined(__GLIBC__)
 
 #include <resolv.h>
 
--- a/src/3rdparty/chromium/net/dns/host_resolver_system_task.cc
+++ b/src/3rdparty/chromium/net/dns/host_resolver_system_task.cc
@@ -310,8 +310,7 @@
 }
 
 void EnsureSystemHostResolverCallReady() {
-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
-    !BUILDFLAG(IS_ANDROID)
+#if defined(__GLIBC__)
   EnsureDnsReloaderInit();
 #elif BUILDFLAG(IS_WIN)
   EnsureWinsockInit();
@@ -396,8 +396,7 @@
   base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
                                                 base::BlockingType::WILL_BLOCK);
 
-#if BUILDFLAG(IS_POSIX) && \
-    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
+#if defined(__GLIBC__)
   DnsReloaderMaybeReload();
 #endif
   auto [ai, err, os_error] = AddressInfo::Get(host, hints, nullptr, network);