| 82 | static void iconv_unregister_cspair(struct iconv_cspair *csp); |
| 83 | |
| 84 | static int |
| 85 | iconv_mod_unload(void) |
| 86 | { |
| 87 | struct iconv_cspair *csp; |
| 88 | |
| 89 | sx_xlock(&iconv_lock); |
| 90 | TAILQ_FOREACH(csp, &iconv_cslist, cp_link) { |
| 91 | if (csp->cp_refcount) { |
| 92 | sx_xunlock(&iconv_lock); |
| 93 | return EBUSY; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | while ((csp = TAILQ_FIRST(&iconv_cslist)) != NULL) |
| 98 | iconv_unregister_cspair(csp); |
| 99 | sx_xunlock(&iconv_lock); |
| 100 | sx_destroy(&iconv_lock); |
| 101 | return 0; |
| 102 | } |
| 103 | |
| 104 | static int |
| 105 | iconv_mod_handler(module_t mod, int type, void *data) |
no test coverage detected