]> jfr.im git - solanum.git/blobdiff - src/ircd.c
Make the ircd start again.
[solanum.git] / src / ircd.c
index 1a8efa10510ffd6b739fc8f5bf6710f8bb5cec9b..cd20e75063dcd40588795cf6ef71ff05664b1b2b 100644 (file)
@@ -541,6 +541,27 @@ main(int argc, char *argv[])
                return -1;
        }
 
+       init_sys();
+
+       ConfigFileEntry.dpath = DPATH;
+       ConfigFileEntry.configfile = CPATH;     /* Server configuration file */
+       ConfigFileEntry.klinefile = KPATH;      /* Server kline file */
+       ConfigFileEntry.dlinefile = DLPATH;     /* dline file */
+       ConfigFileEntry.xlinefile = XPATH;
+       ConfigFileEntry.resvfile = RESVPATH;
+       ConfigFileEntry.connect_timeout = 30;   /* Default to 30 */
+       
+       umask(077);             /* better safe than sorry --SRB */
+
+       myargv = argv;
+       parseargs(&argc, &argv, myopts);
+
+       if(chdir(ConfigFileEntry.dpath))
+       {
+               fprintf(stderr, "Unable to chdir to %s: %s\n", ConfigFileEntry.dpath, strerror(errno));
+               exit(EXIT_FAILURE);
+       }
+
        rb_set_time();
 
        /*
@@ -570,29 +591,13 @@ main(int argc, char *argv[])
        /* Initialise the channel capability usage counts... */
        init_chcap_usage_counts();
 
-       ConfigFileEntry.dpath = DPATH;
-       ConfigFileEntry.configfile = CPATH;     /* Server configuration file */
-       ConfigFileEntry.klinefile = KPATH;      /* Server kline file */
-       ConfigFileEntry.dlinefile = DLPATH;     /* dline file */
-       ConfigFileEntry.xlinefile = XPATH;
-       ConfigFileEntry.resvfile = RESVPATH;
-       ConfigFileEntry.connect_timeout = 30;   /* Default to 30 */
-       myargv = argv;
-       umask(077);             /* better safe than sorry --SRB */
-
-       parseargs(&argc, &argv, myopts);
-
        if(printVersion)
        {
                printf("ircd: version %s(%s)\n", ircd_version, serno);
                exit(EXIT_SUCCESS);
        }
 
-       if(chdir(ConfigFileEntry.dpath))
-       {
-               fprintf(stderr, "Unable to chdir to %s: %s\n", ConfigFileEntry.dpath, strerror(errno));
-               exit(EXIT_FAILURE);
-       }
+
 
        setup_signals();
 
@@ -620,7 +625,6 @@ main(int argc, char *argv[])
        }
 
        /* Init the event subsystem */
-       init_sys();
        rb_lib_init(ircd_log_cb, ircd_restart_cb, ircd_die_cb, !server_state_foreground, maxconnections, DNODE_HEAP_SIZE, FD_HEAP_SIZE);
        rb_linebuf_init(LINEBUF_HEAP_SIZE);