0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 10:08:56 +02:00

ircd::mods: Output linked module list to log on stuck module.

This commit is contained in:
Jason Volk 2019-07-13 18:49:38 -07:00
parent 9343d0ea2b
commit ccfb3cd688

View file

@ -137,6 +137,24 @@ ircd::mods::unload(mod &mod)
void
ircd::mods::handle_stuck(mod &mod)
{
size_t ctr{0};
auto log_level{log::level::DERROR};
mods::ldso::for_each([&ctr, &mod, &log_level]
(const auto &link)
{
if(ldso::name(link) == mod.name())
log_level = log::level::ERROR;
log::logf
{
log, log_level, "Current link:%2lu module '%s'",
ctr++,
ldso::fullname(link),
};
return true;
});
log::critical
{
log, "Module \"%s\" is stuck and failing to unload.",