+ }
+
+ if((load_a_module(path, true, origin, check_core) == false) && check_core)
+ {
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
+ "Error reloading core module: %s: terminating ircd", m_bn);
+ ilog(L_MAIN, "Error loading core module %s: terminating ircd", m_bn);
+ exit(0);
+ }
+
+ mod_notify_clicaps();
+
+ rb_free(info);
+ rb_free(m_bn);
+ rb_free(path);
+}
+
+void
+modules_do_restart(void *unused)
+{
+ unsigned int modnum = 0;
+ rb_dlink_node *ptr, *nptr;
+
+ mod_remember_clicaps();
+
+ RB_DLINK_FOREACH_SAFE(ptr, nptr, module_list.head)
+ {
+ struct module *mod = ptr->data;
+ if(!unload_one_module(mod->name, false))
+ {
+ ilog(L_MAIN, "Module Restart: %s was not unloaded %s",
+ mod->name,
+ mod->core? "(core module)" : "");
+
+ if(!mod->core)
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
+ "Module Restart: %s failed to unload",
+ mod->name);
+ continue;
+ }
+
+ modnum++;
+ }
+
+ load_all_modules(false);
+ load_core_modules(false);
+ rehash(false);