X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=de92872700347dcadb60d03d3d7a6f3d9806a664;hb=02830985a18950497003f3392cf8d6cc30c15c50;hp=29156973c0cd47767beb1b79e6b68809571c720a;hpb=50ecf259b61eb389559dc24a7c4af718c225ec8d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 29156973c..de9287270 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -26,7 +26,6 @@ */ -/* $Core */ #include "inspircd.h" #include @@ -137,6 +136,7 @@ void InspIRCd::Cleanup() DeleteZero(this->Threads); DeleteZero(this->Timers); DeleteZero(this->SE); + Logs->CloseLogs(); DeleteZero(this->Logs); } @@ -155,7 +155,7 @@ void InspIRCd::SetSignals() void InspIRCd::QuickExit(int status) { - exit(0); + exit(status); } bool InspIRCd::DaemonSeed() @@ -207,7 +207,7 @@ void InspIRCd::WritePID(const std::string &filename) #ifndef _WIN32 std::string fname(filename); if (fname.empty()) - fname = DATA_PATH "/inspircd.pid"; + fname = ServerInstance->Config->Paths.PrependData("inspircd.pid"); std::ofstream outfile(fname.c_str()); if (outfile.is_open()) { @@ -231,10 +231,9 @@ InspIRCd::InspIRCd(int argc, char** argv) : * THIS MUST MATCH THE ORDER OF DECLARATION OF THE FUNCTORS, e.g. the methods * themselves within the class. */ - OperQuit("OperQuit", NULL), + OperQuit("operquit", NULL), GenRandom(&HandleGenRandom), IsChannel(&HandleIsChannel), - Rehash(&HandleRehash), IsNick(&HandleIsNick), IsIdent(&HandleIsIdent), OnCheckExemption(&HandleOnCheckExemption) @@ -336,7 +335,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : { case 'c': /* Config filename was set */ - ConfigFileName = optarg; + ConfigFileName = ServerInstance->Config->Paths.PrependConfig(optarg); break; case 0: /* getopt_long_only() set an int variable, just keep going */ @@ -358,7 +357,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : if (do_version) { - std::cout << std::endl << VERSION << " r" << REVISION << std::endl; + std::cout << std::endl << VERSION << " " << REVISION << std::endl; Exit(EXIT_STATUS_NOERROR); } @@ -381,14 +380,14 @@ InspIRCd::InspIRCd(int argc, char** argv) : Logs->AddLogTypes("*", fls, true); } - if (!ServerConfig::FileExists(ConfigFileName.c_str())) + if (!FileSystem::FileExists(ConfigFileName)) { #ifdef _WIN32 /* Windows can (and defaults to) hide file extensions, so let's play a bit nice for windows users. */ std::string txtconf = this->ConfigFileName; txtconf.append(".txt"); - if (ServerConfig::FileExists(txtconf.c_str())) + if (FileSystem::FileExists(txtconf)) { ConfigFileName = txtconf; } @@ -701,7 +700,7 @@ void InspIRCd::Run() if ((TIME.tv_sec % 3600) == 0) { Users->GarbageCollect(); - FOREACH_MOD(I_OnGarbageCollect, OnGarbageCollect()); + FOREACH_MOD(OnGarbageCollect, ()); } Timers->TickTimers(TIME.tv_sec); @@ -709,7 +708,7 @@ void InspIRCd::Run() if ((TIME.tv_sec % 5) == 0) { - FOREACH_MOD(I_OnBackgroundTimer,OnBackgroundTimer(TIME.tv_sec)); + FOREACH_MOD(OnBackgroundTimer, (TIME.tv_sec)); SNO->FlushSnotices(); } }