Network: Update DNSSettingsView after previous API deprecation.
Create a res_state on the stack and initialize it instead of using the private API.
This commit is contained in:
@@ -196,22 +196,22 @@ DNSSettingsView::_LoadDNSConfiguration()
|
|||||||
if (res_init() != 0)
|
if (res_init() != 0)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
res_state state = __res_get_state();
|
struct __res_state state;
|
||||||
|
memset(&state, 0, sizeof(struct __res_state));
|
||||||
|
|
||||||
if (state != NULL) {
|
if (res_ninit(&state) != 0)
|
||||||
for (int i = 0; i < state->nscount; i++) {
|
return B_ERROR;
|
||||||
char* address = inet_ntoa(state->nsaddr_list[i].sin_addr);
|
|
||||||
fServerListView->AddItem(new BStringItem(address));
|
|
||||||
fRevertList.Add(address);
|
|
||||||
}
|
|
||||||
|
|
||||||
fDomain->SetText(state->dnsrch[0]);
|
for (int i = 0; i < state.nscount; i++) {
|
||||||
|
char* address = inet_ntoa(state.nsaddr_list[i].sin_addr);
|
||||||
__res_put_state(state);
|
fServerListView->AddItem(new BStringItem(address));
|
||||||
return B_OK;
|
fRevertList.Add(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_ERROR;
|
fDomain->SetText(state.dnsrch[0]);
|
||||||
|
|
||||||
|
res_nclose(&state);
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user