diff options
Diffstat (limited to 'chromium/patches/021-musl-no-res-ninit.patch')
| -rw-r--r-- | chromium/patches/021-musl-no-res-ninit.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chromium/patches/021-musl-no-res-ninit.patch b/chromium/patches/021-musl-no-res-ninit.patch new file mode 100644 index 0000000..d74f6cd --- /dev/null +++ b/chromium/patches/021-musl-no-res-ninit.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | similar to dns-resolver.patch, musl doesn't have res_ninit and so on | ||
| 2 | -- | ||
| 3 | --- a/net/dns/public/scoped_res_state.cc | ||
| 4 | +++ b/net/dns/public/scoped_res_state.cc | ||
| 5 | @@ -13,7 +13,7 @@ | ||
| 6 | namespace net { | ||
| 7 | |||
| 8 | ScopedResState::ScopedResState() { | ||
| 9 | -#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) | ||
| 10 | +#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || defined(_GNU_SOURCE) | ||
| 11 | // Note: res_ninit in glibc always returns 0 and sets RES_INIT. | ||
| 12 | // res_init behaves the same way. | ||
| 13 | memset(&_res, 0, sizeof(_res)); | ||
| 14 | @@ -25,16 +25,8 @@ | ||
| 15 | } | ||
| 16 | |||
| 17 | ScopedResState::~ScopedResState() { | ||
| 18 | -#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) | ||
| 19 | - | ||
| 20 | - // Prefer res_ndestroy where available. | ||
| 21 | -#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD) | ||
| 22 | - res_ndestroy(&res_); | ||
| 23 | -#else | ||
| 24 | - res_nclose(&res_); | ||
| 25 | -#endif // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD) | ||
| 26 | - | ||
| 27 | -#endif // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) | ||
| 28 | + // musl res_init() doesn't actually do anything | ||
| 29 | + // no destruction is necessary as no memory has been allocated | ||
| 30 | } | ||
| 31 | |||
| 32 | bool ScopedResState::IsValid() const { | ||