DNS prefs: use thread-safe DNS settings getter

__res_state can't be used with pthreads involved, instead use
__res_get_state and __res_put_state which maintain a pool of res_state
instances.

Fixes #12195.
This commit is contained in:
Adrien Destugues 2015-07-14 11:02:56 +02:00
parent 58f9556840
commit d585e4c396

View File

@ -196,7 +196,7 @@ DNSSettingsView::_LoadDNSConfiguration()
if (res_init() != 0)
return B_ERROR;
res_state state = __res_state();
res_state state = __res_get_state();
if (state != NULL) {
for (int i = 0; i < state->nscount; i++) {
@ -206,6 +206,8 @@ DNSSettingsView::_LoadDNSConfiguration()
}
fDomain->SetText(state->dnsrch[0]);
__res_put_state(state);
return B_OK;
}