diff --git a/include/struct.h b/include/struct.h index fe68a5468..d278da0cc 100644 --- a/include/struct.h +++ b/include/struct.h @@ -755,6 +755,7 @@ struct LoopStruct { unsigned do_bancheck_spamf_user : 1; /* perform 'user' spamfilter bancheck */ unsigned do_bancheck_spamf_away : 1; /* perform 'away' spamfilter bancheck */ unsigned ircd_rehashing : 1; + unsigned ircd_terminating : 1; unsigned tainted : 1; Client *rehash_save_cptr, *rehash_save_client; int rehash_save_sig; diff --git a/src/ircd.c b/src/ircd.c index d60787aca..8aec388f5 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -82,6 +82,7 @@ void s_die() Client *client; if (!IsService) { + loop.ircd_terminating = 1; unload_all_modules(); list_for_each_entry(client, &lclient_list, lclient_node) @@ -96,6 +97,7 @@ void s_die() ControlService(hService, SERVICE_CONTROL_STOP, &status); } #else + loop.ircd_terminating = 1; unload_all_modules(); unlink(conf_files ? conf_files->pid_file : IRCD_PIDFILE); exit(0);