privops: separate res_init() call

Move the res_init() call from do_name_to_ipaddress() into a separate
privops operation. Use it in ntp_sources and avoid unnecessary
res_init() calls in the main thread.
This commit is contained in:
Miroslav Lichvar
2017-03-07 16:43:33 +01:00
parent 5187c08c90
commit 6db8ec1ba2
4 changed files with 52 additions and 4 deletions

View File

@@ -39,6 +39,7 @@
#include "local.h"
#include "memory.h"
#include "nameserv_async.h"
#include "privops.h"
#include "sched.h"
/* ================================================== */
@@ -469,7 +470,7 @@ resolve_sources(void *arg)
assert(!resolving_source);
DNS_Reload();
PRV_ReloadDNS();
/* Start with the first source in the list, name_resolve_handler
will iterate over the rest */