dnsapi: _res is per-thread in glibc.
This mirrors Dan Kegel's fix for iphlpapi.
This commit is contained in:
parent
af68ef68ce
commit
c058490b69
|
@ -65,16 +65,12 @@ static CRITICAL_SECTION resolver_cs = { &resolver_cs_debug, -1, 0, 0, 0, 0 };
|
||||||
#define LOCK_RESOLVER() do { EnterCriticalSection( &resolver_cs ); } while (0)
|
#define LOCK_RESOLVER() do { EnterCriticalSection( &resolver_cs ); } while (0)
|
||||||
#define UNLOCK_RESOLVER() do { LeaveCriticalSection( &resolver_cs ); } while (0)
|
#define UNLOCK_RESOLVER() do { LeaveCriticalSection( &resolver_cs ); } while (0)
|
||||||
|
|
||||||
static int resolver_initialised;
|
|
||||||
|
|
||||||
/* call res_init() just once because of a bug in Mac OS X 10.4 */
|
/* call res_init() just once because of a bug in Mac OS X 10.4 */
|
||||||
|
/* call once per thread on systems that have per-thread _res */
|
||||||
static void initialise_resolver( void )
|
static void initialise_resolver( void )
|
||||||
{
|
{
|
||||||
if (!resolver_initialised)
|
if ((_res.options & RES_INIT) == 0)
|
||||||
{
|
|
||||||
res_init();
|
res_init();
|
||||||
resolver_initialised = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *dns_section_to_str( ns_sect section )
|
static const char *dns_section_to_str( ns_sect section )
|
||||||
|
|
|
@ -69,7 +69,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
|
||||||
|
|
||||||
/* call res_init() just once because of a bug in Mac OS X 10.4 */
|
/* call res_init() just once because of a bug in Mac OS X 10.4 */
|
||||||
/* Call once per thread on systems that have per-thread _res. */
|
/* Call once per thread on systems that have per-thread _res. */
|
||||||
/* FIXME: should do same fix in dnsapi (or use dnsapi here?) */
|
|
||||||
static void initialise_resolver(void)
|
static void initialise_resolver(void)
|
||||||
{
|
{
|
||||||
if ((_res.options & RES_INIT) == 0)
|
if ((_res.options & RES_INIT) == 0)
|
||||||
|
|
Loading…
Reference in New Issue