]> jfr.im git - solanum.git/blobdiff - ircd/ircd.c
Merge branch 'master' of github.com:charybdis-ircd/charybdis
[solanum.git] / ircd / ircd.c
index 668e912004cafcf9df4809f91a12d81da216d5f3..432931deeaef6226732bc8c5a14857529af057ea 100644 (file)
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
- *
- *  $Id$
  */
 
-#include "ratbox_lib.h"
+#include "rb_lib.h"
 #include "stdinc.h"
 #include "setup.h"
 #include "config.h"
@@ -101,14 +99,14 @@ const char *logFileName = LPATH;
 const char *pidFileName = PPATH;
 
 char **myargv;
-int dorehash = 0;
-int dorehashbans = 0;
-int doremotd = 0;
-int kline_queued = 0;
-int server_state_foreground = 0;
-int opers_see_all_users = 0;
-int ssl_ok = 0;
-int zlib_ok = 1;
+bool dorehash = false;
+bool dorehashbans = false;
+bool doremotd = false;
+bool kline_queued = false;
+bool server_state_foreground = false;
+bool opers_see_all_users = false;
+bool ssl_ok = false;
+bool zlib_ok = true;
 
 int testing_conf = 0;
 time_t startup_time;
@@ -280,13 +278,13 @@ check_rehash(void *unused)
        if(dorehash)
        {
                rehash(1);
-               dorehash = 0;
+               dorehash = false;
        }
 
        if(dorehashbans)
        {
                rehash_bans(1);
-               dorehashbans = 0;
+               dorehashbans = false;
        }
 
        if(doremotd)
@@ -294,7 +292,7 @@ check_rehash(void *unused)
                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                     "Got signal SIGUSR1, reloading ircd motd file");
                cache_user_motd();
-               doremotd = 0;
+               doremotd = false;
        }
 }
 
@@ -450,13 +448,13 @@ setup_corefile(void)
 static void
 ircd_log_cb(const char *str)
 {
-       ilog(L_MAIN, "libratbox reports: %s", str);
+       ilog(L_MAIN, "librb reports: %s", str);
 }
 
 static void
 ircd_restart_cb(const char *str)
 {
-       inotice("libratbox has called the restart callback: %s", str);
+       inotice("librb has called the restart callback: %s", str);
        restart(str);
 }
 
@@ -473,11 +471,11 @@ ircd_die_cb(const char *str)
        if(str != NULL)
        {
                /* Try to get the message out to currently logged in operators. */
-               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "libratbox has called the die callback..aborting: %s", str);
-               inotice("libratbox has called the die callback..aborting: %s", str);
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "librb has called the die callback..aborting: %s", str);
+               inotice("librb has called the die callback..aborting: %s", str);
        }
        else
-               inotice("libratbox has called the die callback..aborting");
+               inotice("librb has called the die callback..aborting");
 
        unlink(pidFileName);
        exit(EXIT_FAILURE);
@@ -607,7 +605,7 @@ charybdis_main(int argc, char *argv[])
        setup_signals();
 
        if (testing_conf)
-               server_state_foreground = 1;
+               server_state_foreground = true;
 
        /* Make sure fd 0, 1 and 2 are in use -- jilles */
        do
@@ -665,11 +663,13 @@ charybdis_main(int argc, char *argv[])
 
        init_auth();            /* Initialise the auth code */
        init_authd();           /* Start up authd. */
+       init_dns();             /* Start up DNS query system */
+
        privilegeset_set_new("default", "", 0);
 
        if (testing_conf)
                fprintf(stderr, "\nBeginning config test\n");
-       read_conf_files(YES);   /* cold start init conf files */
+       read_conf_files(true);  /* cold start init conf files */
 
        mod_add_path(MODULE_DIR);
        mod_add_path(MODULE_DIR "/autoload");
@@ -713,10 +713,10 @@ charybdis_main(int argc, char *argv[])
                if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list))
                {
                        ilog(L_MAIN, "WARNING: Unable to setup SSL.");
-                       ssl_ok = 0;
+                       ssl_ok = false;
                }
                else
-                       ssl_ok = 1;
+                       ssl_ok = true;
        }
 
        if (testing_conf)