[haiku-commits] haiku: hrev49403 - src/add-ons/network_settings/dnsclient

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 14 Jul 2015 11:04:32 +0200 (CEST)

hrev49403 adds 1 changeset to branch 'master'
old head: 58f955684043cba7a3adf6b72f781263352856c7
new head: d585e4c396ab5aed659dd13b6713366254865747
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=d585e4c396ab+%5E58f955684043

----------------------------------------------------------------------------

d585e4c396ab: 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.

[ Adrien Destugues <pulkomandy@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision: hrev49403
Commit: d585e4c396ab5aed659dd13b6713366254865747
URL: http://cgit.haiku-os.org/haiku/commit/?id=d585e4c396ab
Author: Adrien Destugues <pulkomandy@xxxxxxxxx>
Date: Tue Jul 14 09:02:56 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/12195

----------------------------------------------------------------------------

1 file changed, 3 insertions(+), 1 deletion(-)
src/add-ons/network_settings/dnsclient/DNSSettingsView.cpp | 4 +++-

----------------------------------------------------------------------------

diff --git a/src/add-ons/network_settings/dnsclient/DNSSettingsView.cpp
b/src/add-ons/network_settings/dnsclient/DNSSettingsView.cpp
index 51ee106..131ec34 100644
--- a/src/add-ons/network_settings/dnsclient/DNSSettingsView.cpp
+++ b/src/add-ons/network_settings/dnsclient/DNSSettingsView.cpp
@@ -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;
}



Other related posts:

  • » [haiku-commits] haiku: hrev49403 - src/add-ons/network_settings/dnsclient - pulkomandy