Automatically initialize the resolv process

This commit is contained in:
Adam Dunkels 2014-12-02 10:43:46 +01:00
parent 19c7ae0dcd
commit 990682229c

View File

@ -1199,6 +1199,16 @@ PROCESS_THREAD(resolv_process, ev, data)
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
static void
init(void)
{
static uint8_t initialized = 0;
if(!initialized) {
process_start(&resolv_process, NULL);
initialized = 1;
}
}
/*---------------------------------------------------------------------------*/
#if RESOLV_AUTO_REMOVE_TRAILING_DOTS
static const char *
remove_trailing_dots(const char *name) {
@ -1232,6 +1242,8 @@ resolv_query(const char *name)
register struct namemap *nameptr = 0;
init();
lseq = lseqi = 0;
/* Remove trailing dots, if present. */