Merge "Revert most of "Cleanup: Delete dead code."" into lmp-dev

This commit is contained in:
Paul Jensen 2014-08-06 18:32:02 +00:00 committed by Android (Google) Code Review
commit 7a5f0952a2
2 changed files with 14 additions and 0 deletions

View File

@ -61,6 +61,9 @@ int android_getaddrinfofornet(const char *, const char *, const struct addrinfo
extern void _resolv_set_nameservers_for_net(unsigned netid,
const char** servers, int numservers, const char *domains) __used_in_netd;
/* flush the cache associated with a certain network */
extern void _resolv_flush_cache_for_net(unsigned netid) __used_in_netd;
/* delete the cache associated with a certain network */
extern void _resolv_delete_cache_for_net(unsigned netid) __used_in_netd;

View File

@ -1831,6 +1831,17 @@ _get_res_cache_for_net_locked(unsigned netid)
return cache;
}
void
_resolv_flush_cache_for_net(unsigned netid)
{
pthread_once(&_res_cache_once, _res_cache_init);
pthread_mutex_lock(&_res_cache_list_lock);
_flush_cache_for_net_locked(netid);
pthread_mutex_unlock(&_res_cache_list_lock);
}
static void
_flush_cache_for_net_locked(unsigned netid)
{