From 417432f2be811573326b8366783020fa1fd63eec Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 14 Dec 2005 17:53:32 +0000 Subject: TittyBiscuits! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2429 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 65 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 60e0c11bd..4cab20c52 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -468,6 +468,38 @@ InspIRCd::InspIRCd(int argc, char** argv) lowermap[(unsigned)']'] = '}'; lowermap[(unsigned)'\\'] = '|'; + + OpenLog(argc, argv); + Config->ClearStack(); + Config->Read(true,NULL); + CheckRoot(); + SetupCommandTable(); + AddServerName(Config->ServerName); + CheckDie(); + boundPortCount = BindPorts(); + + printf("\n"); + startup_time = time(NULL); + + if (!Config->nofork) + { + if (DaemonSeed() == ERROR) + { + printf("ERROR: could not go into daemon mode. Shutting down.\n"); + Exit(ERROR); + } + } + + /* Because of limitations in kqueue on freebsd, we must fork BEFORE we + * initialize the socket engine. + */ + SE = new SocketEngine(); + + /* We must load the modules AFTER initializing the socket engine, now */ + LoadAllModules(); + + printf("\nInspIRCd is now running!\n"); + return; } @@ -1550,39 +1582,6 @@ int InspIRCd::Run() sockaddr_in sock_us; // our port number socklen_t uslen; // length of our port number - /* Beta 7 moved all this stuff out of the main function - * into smaller sub-functions, much tidier -- Brain - */ - OpenLog(argv, argc); - Config->ClearStack(); - Config->Read(true,NULL); - CheckRoot(); - SetupCommandTable(); - AddServerName(Config->ServerName); - CheckDie(); - boundPortCount = BindPorts(); - - printf("\n"); - startup_time = time(NULL); - - if (!Config->nofork) - { - if (DaemonSeed() == ERROR) - { - printf("ERROR: could not go into daemon mode. Shutting down.\n"); - Exit(ERROR); - } - } - - /* Because of limitations in kqueue on freebsd, we must fork BEFORE we - * initialize the socket engine. - */ - SE = new SocketEngine(); - - /* We must load the modules AFTER initializing the socket engine, now */ - LoadAllModules(); - - printf("\nInspIRCd is now running!\n"); if (!Config->nofork) { freopen("/dev/null","w",stdout); -- cgit v1.2.3