summaryrefslogtreecommitdiff
path: root/src/modules.c
diff options
context:
space:
mode:
authorgeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-08-06 16:32:41 +0000
committergeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-08-06 16:32:41 +0000
commit11b73a098ca0276bb4554d57098e4c8c86b0804b (patch)
tree3130fa50fc9dfe705c48daeb729a402a07d79d88 /src/modules.c
parenta1edb7a0c2b734be7f8d6f870bf7991c79a299f2 (diff)
BUILD : 1.7.14 (1124) BUGS : 552 NOTES : Added a way to modules_unload_all() to specify if we should unload the protocol module or not
git-svn-id: svn://svn.anope.org/anope/trunk@1124 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@848 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules.c')
-rw-r--r--src/modules.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/modules.c b/src/modules.c
index bbe44b18b..e1c2225da 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -234,7 +234,7 @@ void modules_delayed_init(void)
* And if that isn't enough discouragement, you'll wake up with your
* both legs broken tomorrow ;) -GD
*/
-void modules_unload_all(boolean fini)
+void modules_unload_all(boolean fini, boolean unload_proto)
{
#ifdef USE_MODULES
int idx;
@@ -245,26 +245,28 @@ void modules_unload_all(boolean fini)
mh = MODULE_HASH[idx];
while (mh) {
next = mh->next;
- mod_current_module = mh->m;
- if(fini) {
- func = (void (*)(void))ano_modsym(mh->m->handle, "AnopeFini");
- if (func) {
- mod_current_module_name = mh->m->name;
- func(); /* exec AnopeFini */
- mod_current_module_name = NULL;
- }
-
- if (prepForUnload(mh->m) != MOD_ERR_OK) {
- mh = next;
- continue;
- }
-
- if ((ano_modclose(mh->m->handle)) != 0)
- alog(ano_moderr());
- else
- delModule(mh->m);
- } else {
- delModule(mh->m);
+ if (unload_proto || (mh->m->type != PROTOCOL)) {
+ mod_current_module = mh->m;
+ if(fini) {
+ func = (void (*)(void))ano_modsym(mh->m->handle, "AnopeFini");
+ if (func) {
+ mod_current_module_name = mh->m->name;
+ func(); /* exec AnopeFini */
+ mod_current_module_name = NULL;
+ }
+
+ if (prepForUnload(mh->m) != MOD_ERR_OK) {
+ mh = next;
+ continue;
+ }
+
+ if ((ano_modclose(mh->m->handle)) != 0)
+ alog(ano_moderr());
+ else
+ delModule(mh->m);
+ } else {
+ delModule(mh->m);
+ }
}
mh = next;
}