war on lhfs
[citadel.git] / citadel / control.c
index cabf6df1314a3cc439230345db9f0f2798f0b8c9..a99bbf6f67f56d671539926c7b1b0ffae247a715 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This module handles states which are global to the entire server.
  *
- * Copyright (c) 1987-2019 by the citadel.org team
+ * Copyright (c) 1987-2021 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -123,7 +123,7 @@ void migrate_legacy_control_record(void)
        struct legacy_ctrl_format c;
        memset(&c, 0, sizeof(c));
 
-       fp = fopen(file_citadel_control, "rb+");
+       fp = fopen("citadel.control", "rb+");
        if (fp != NULL) {
                syslog(LOG_INFO, "control: legacy format record found -- importing to db");
                fread(&c, sizeof(struct legacy_ctrl_format), 1, fp);
@@ -137,8 +137,8 @@ void migrate_legacy_control_record(void)
                CtdlSetConfigLong(      "MMfulltext",                   c.MMfulltext);
 
                fclose(fp);
-               if (unlink(file_citadel_control) != 0) {
-                       fprintf(stderr, "Unable to remove legacy control record %s after migrating it.\n", file_citadel_control);
+               if (unlink("citadel.control") != 0) {
+                       fprintf(stderr, "Unable to remove legacy control record after migrating it.\n");
                        fprintf(stderr, "Exiting to prevent data corruption.\n");
                        exit(CTDLEXIT_CONFIG);
                }
@@ -181,7 +181,7 @@ long get_new_message_number(void)
 /*
  * CtdlGetCurrentMessageNumber()  -  Obtain the current highest message number in the system
  * This provides a quick way to initialise a variable that might be used to indicate
- * messages that should not be processed. EG. a new Sieve script will use this
+ * messages that should not be processed.   For example, an inbox rules script will use this
  * to record determine that messages older than this should not be processed.
  *
  * (Why is this function here?  Can't we just go straight to the config variable it fetches?)
@@ -791,10 +791,6 @@ void cmd_gvdn(char *argbuf)
 /*                      MODULE INITIALIZATION STUFF                          */
 /*****************************************************************************/
 
-void control_cleanup(void)
-{
-       DeleteHash(&CfgNameHash);
-}
 CTDL_MODULE_INIT(control)
 {
        if (!threading) {
@@ -806,8 +802,6 @@ CTDL_MODULE_INIT(control)
 
                CtdlRegisterProtoHook(cmd_gvdn, "GVDN", "get valid domain names");
                CtdlRegisterProtoHook(cmd_conf, "CONF", "get/set system configuration");
-               CtdlRegisterCleanupHook(control_cleanup);
-
        }
        /* return our id for the Log */
        return "control";