mirror of
				https://gitlab.alpinelinux.org/alpine/aports.git
				synced 2025-10-31 08:21:49 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			967 B
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			967 B
		
	
	
	
		
			Diff
		
	
	
	
	
	
| --- 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 {
 |