34 lines
1.1 KiB
Diff
34 lines
1.1 KiB
Diff
Source: https://git.alpinelinux.org/aports/plain/community/chromium/no-res-ninit-nclose.patch
|
|
similar to dns-resolver.patch, musl doesn't have res_ninit and so on
|
|
--
|
|
--- a/net/dns/public/scoped_res_state.cc
|
|
+++ 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) || 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 {
|