From 3da27f7c9c1077f285f53b1e80a1befffe104770 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 6 Jul 2017 14:45:53 -0700 Subject: Fixes for async resolver, plus a test suite for it. --- src/platform/posix/posix_thread.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/platform/posix/posix_thread.c') diff --git a/src/platform/posix/posix_thread.c b/src/platform/posix/posix_thread.c index 171a87b9..4137984f 100644 --- a/src/platform/posix/posix_thread.c +++ b/src/platform/posix/posix_thread.c @@ -308,8 +308,20 @@ nni_plat_init(int (*helper)(void)) return (rv); } + if ((rv = nni_posix_resolv_sysinit()) != 0) { + pthread_mutex_unlock(&nni_plat_lock); + nni_posix_pollq_sysfini(); + (void) close(nni_plat_devnull); + pthread_mutexattr_destroy(&nni_mxattr); + pthread_condattr_destroy(&nni_cvattr); + pthread_attr_destroy(&nni_pthread_attr); + return (rv); + + } + if (pthread_atfork(NULL, NULL, nni_atfork_child) != 0) { pthread_mutex_unlock(&nni_plat_lock); + nni_posix_resolv_sysfini(); nni_posix_pollq_sysfini(); (void) close(devnull); pthread_mutexattr_destroy(&nni_mxattr); -- cgit v1.2.3-70-g09d2