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:
parent
58f9556840
commit
d585e4c396
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user