]> jfr.im git - solanum.git/blobdiff - ircd/ircd.c
getopt: don't modify argv as it breaks restart()
[solanum.git] / ircd / ircd.c
index 5c576fc84fa63d23562ad7f06d614da659a9258c..3a16a40c7690df6ec5ba9d6cfc27a9acf3d09286 100644 (file)
 #include "patchlevel.h"
 #include "serno.h"
 #include "sslproc.h"
+#include "wsproc.h"
 #include "chmode.h"
 #include "privilege.h"
 #include "bandbi.h"
-#include "authd.h"
+#include "authproc.h"
 #include "operhash.h"
 
 /* /quote set variables */
@@ -93,10 +94,10 @@ rb_dlink_list global_serv_list;    /* global servers on the network */
 rb_dlink_list local_oper_list;     /* our opers, duplicated in lclient_list */
 rb_dlink_list oper_list;           /* network opers */
 
-char **myargv;
-bool dorehash = false;
-bool dorehashbans = false;
-bool doremotd = false;
+char * const *myargv;
+volatile sig_atomic_t dorehash = false;
+volatile sig_atomic_t dorehashbans = false;
+volatile sig_atomic_t doremotd = false;
 bool kline_queued = false;
 bool server_state_foreground = false;
 bool opers_see_all_users = false;
@@ -644,7 +645,7 @@ seed_random(void *unused)
  * Side Effects - this is where the ircd gets going right now
  */
 int
-charybdis_main(int argc, char *argv[])
+charybdis_main(int argc, char * const argv[])
 {
        int fd;
 
@@ -778,9 +779,6 @@ charybdis_main(int argc, char *argv[])
 
         construct_cflags_strings();
 
-       load_all_modules(1);
-       load_core_modules(1);
-
        init_authd();           /* Start up authd. */
        init_dns();             /* Start up DNS query system */
 
@@ -792,11 +790,14 @@ charybdis_main(int argc, char *argv[])
 
        mod_add_path(MODULE_DIR);
        mod_add_path(MODULE_DIR "/autoload");
+       load_all_modules(1);
+       load_core_modules(1);
 
        init_isupport();
 
        init_bandb();
        init_ssld();
+       init_wsockd();
 
        rehash_bans();
 
@@ -845,8 +846,6 @@ charybdis_main(int argc, char *argv[])
                return 0;       /* Why? We want the launcher to exit out. */
        }
 
-       configure_authd();
-
        me.from = &me;
        me.servptr = &me;
        SetMe(&me);
@@ -865,6 +864,8 @@ charybdis_main(int argc, char *argv[])
        load_help();
        open_logfiles();
 
+       configure_authd();
+
        ilog(L_MAIN, "Server Ready");
 
        /* We want try_connections to be called as soon as possible now! -- adrian */