]> jfr.im git - solanum.git/blobdiff - ircd/ircd.c
getopt: don't modify argv as it breaks restart()
[solanum.git] / ircd / ircd.c
index 627d469ba22917127a0f094534814c0f5d2328dc..3a16a40c7690df6ec5ba9d6cfc27a9acf3d09286 100644 (file)
@@ -39,7 +39,6 @@
 #include "numeric.h"
 #include "parse.h"
 #include "restart.h"
-#include "s_auth.h"
 #include "s_conf.h"
 #include "logger.h"
 #include "s_serv.h"            /* try_connections */
 #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 */
@@ -94,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;
@@ -396,6 +396,7 @@ initialize_server_capabs(void)
  * output       - none
  * side effects - items in ircd_paths[] array are relocated
  */
+#ifdef _WIN32
 static void
 relocate_paths(void)
 {
@@ -466,6 +467,7 @@ relocate_paths(void)
        ircd_paths[IRCD_PATH_BIN] = rb_strdup(workbuf);
        ircd_paths[IRCD_PATH_LIBEXEC] = rb_strdup(workbuf);
 }
+#endif
 
 /*
  * write_pidfile
@@ -643,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;
 
@@ -656,7 +658,7 @@ charybdis_main(int argc, char *argv[])
        }
 #endif
 
-#ifndef ENABLE_FHS_PATHS
+#ifdef _WIN32
        relocate_paths();
 #endif
 
@@ -777,10 +779,6 @@ charybdis_main(int argc, char *argv[])
 
         construct_cflags_strings();
 
-       load_all_modules(1);
-       load_core_modules(1);
-
-       init_auth();            /* Initialise the auth code */
        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();
 
@@ -863,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 */