Fix unloading of libiconv module.
Previously it would either loop infinitely or exit with error leaking a lock. Reported by: Will DeVries Approved by: trasz (mentor) MFC after: 1 week
This commit is contained in:
parent
7aa2051e40
commit
414d9b2ed0
@ -84,9 +84,11 @@ iconv_mod_unload(void)
|
|||||||
struct iconv_cspair *csp;
|
struct iconv_cspair *csp;
|
||||||
|
|
||||||
sx_xlock(&iconv_lock);
|
sx_xlock(&iconv_lock);
|
||||||
while ((csp = TAILQ_FIRST(&iconv_cslist)) != NULL) {
|
TAILQ_FOREACH(csp, &iconv_cslist, cp_link) {
|
||||||
if (csp->cp_refcount)
|
if (csp->cp_refcount) {
|
||||||
|
sx_xunlock(&iconv_lock);
|
||||||
return EBUSY;
|
return EBUSY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((csp = TAILQ_FIRST(&iconv_cslist)) != NULL)
|
while ((csp = TAILQ_FIRST(&iconv_cslist)) != NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user