Skip to content

Commit

Permalink
DNS prefs: use thread-safe DNS settings getter
Browse files Browse the repository at this point in the history
__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.
  • Loading branch information
pulkomandy committed Jul 14, 2015
1 parent 58f9556 commit d585e4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/add-ons/network_settings/dnsclient/DNSSettingsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -206,6 +206,8 @@ DNSSettingsView::_LoadDNSConfiguration()
}

fDomain->SetText(state->dnsrch[0]);

__res_put_state(state);
return B_OK;
}

Expand Down

0 comments on commit d585e4c

Please sign in to comment.