summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-09 11:33:10 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-09 11:33:10 +0000
commit09afa5085614e0224a296abd082fce205003c3fe (patch)
tree444d54deea5f10e3045e0a8a016f9623499f513e /src/inspircd.cpp
parent6d4128715da39b1e097642a64ee0bd40586d9a38 (diff)
ServerConfig extern moved into class InspIRCd
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4808 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index a9d4cfb19..c92e862b0 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -89,7 +89,6 @@ time_t TIME = time(NULL), OLDTIME = time(NULL);
// by an integer, meaning there is no need for a scan/search operation.
userrec* fd_ref_table[MAX_DESCRIPTORS];
Server* MyServer = new Server;
-ServerConfig *Config = new ServerConfig;
user_hash clientlist;
chan_hash chanlist;
servernamelist servernames;
@@ -123,8 +122,8 @@ bool FindServerName(const std::string &servername)
void Exit(int status)
{
- if (Config->log_file)
- fclose(Config->log_file);
+ if (ServerInstance->Config->log_file)
+ fclose(ServerInstance->Config->log_file);
send_error("Server shutdown.");
exit (status);
}
@@ -140,8 +139,8 @@ void InspIRCd::Start()
void Killed(int status)
{
- if (Config->log_file)
- fclose(Config->log_file);
+ if (ServerInstance->Config->log_file)
+ fclose(ServerInstance->Config->log_file);
send_error("Server terminated.");
exit(status);
}
@@ -149,9 +148,9 @@ void Killed(int status)
void Rehash(int status)
{
WriteOpers("Rehashing config file %s due to SIGHUP",CleanFilename(CONFIG_FILE));
- fclose(Config->log_file);
+ fclose(ServerInstance->Config->log_file);
OpenLog(NULL,0);
- Config->Read(false,NULL);
+ ServerInstance->Config->Read(false,NULL);
FOREACH_MOD(I_OnRehash,OnRehash(""));
}
@@ -234,7 +233,8 @@ void InspIRCd::MakeLowerMap()
InspIRCd::InspIRCd(int argc, char** argv)
{
bool SEGVHandler = false;
-
+ this->Config = new ServerConfig;
+ ServerInstance = this;
this->Start();
module_sockets.clear();
this->startup_time = time(NULL);
@@ -907,8 +907,6 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
int InspIRCd::Run()
{
- /* Until THIS point, ServerInstance == NULL */
-
this->Res = new DNS();
LoadAllModules(this);