svn commit: r321177 - stable/11/lib/libc/net
Mark Johnston
markj at FreeBSD.org
Tue Jul 18 23:02:36 UTC 2017
Author: markj
Date: Tue Jul 18 23:02:34 2017
New Revision: 321177
URL: https://svnweb.freebsd.org/changeset/base/321177
Log:
MFC r320895:
Don't dlclose NSS modules from nss_atexit().
Modified:
stable/11/lib/libc/net/nsdispatch.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/lib/libc/net/nsdispatch.c
==============================================================================
--- stable/11/lib/libc/net/nsdispatch.c Tue Jul 18 21:09:29 2017 (r321176)
+++ stable/11/lib/libc/net/nsdispatch.c Tue Jul 18 23:02:34 2017 (r321177)
@@ -525,8 +525,8 @@ fin:
vector_sort(_nsmod, _nsmodsize, sizeof(*_nsmod), string_compare);
}
+static int exiting = 0;
-
static void
ns_mod_free(ns_mod *mod)
{
@@ -536,12 +536,10 @@ ns_mod_free(ns_mod *mod)
return;
if (mod->unregister != NULL)
mod->unregister(mod->mtab, mod->mtabsize);
- if (mod->handle != nss_builtin_handle)
+ if (mod->handle != nss_builtin_handle && !exiting)
(void)dlclose(mod->handle);
}
-
-
/*
* Cleanup
*/
@@ -550,6 +548,7 @@ nss_atexit(void)
{
int isthreaded;
+ exiting = 1;
isthreaded = __isthreaded;
if (isthreaded)
(void)_pthread_rwlock_wrlock(&nss_lock);
@@ -560,8 +559,6 @@ nss_atexit(void)
if (isthreaded)
(void)_pthread_rwlock_unlock(&nss_lock);
}
-
-
/*
* Finally, the actual implementation.
More information about the svn-src-stable-11
mailing list