* Handle preload files that failed to load any modules. */
| 1708 | * Handle preload files that failed to load any modules. |
| 1709 | */ |
| 1710 | static void |
| 1711 | linker_preload_finish(void *arg) |
| 1712 | { |
| 1713 | linker_file_t lf, nlf; |
| 1714 | |
| 1715 | sx_xlock(&kld_sx); |
| 1716 | TAILQ_FOREACH_SAFE(lf, &linker_files, link, nlf) { |
| 1717 | /* |
| 1718 | * If all of the modules in this file failed to load, unload |
| 1719 | * the file and return an error of ENOEXEC. (Parity with |
| 1720 | * linker_load_file.) |
| 1721 | */ |
| 1722 | if ((lf->flags & LINKER_FILE_MODULES) != 0 && |
| 1723 | TAILQ_EMPTY(&lf->modules)) { |
| 1724 | linker_file_unload(lf, LINKER_UNLOAD_FORCE); |
| 1725 | continue; |
| 1726 | } |
| 1727 | |
| 1728 | lf->flags &= ~LINKER_FILE_MODULES; |
| 1729 | lf->userrefs++; /* so we can (try to) kldunload it */ |
| 1730 | } |
| 1731 | sx_xunlock(&kld_sx); |
| 1732 | } |
| 1733 | |
| 1734 | /* |
| 1735 | * Attempt to run after all DECLARE_MODULE SYSINITs. Unfortunately they can be |
nothing calls this directly
no test coverage detected