summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-02 23:44:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-02 23:44:56 +0000
commit3c19bd7b6603a26cf365a1a5204dfbc7adc34d98 (patch)
tree5b18cc10ac20024f0b774eb62373efba8fc945ed /src
parent6cf3fc6b36e2046c36b729530117572ba44aafd7 (diff)
Back out the tweaks i made here, keep only the clear screen stuff
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7218 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 9e1d753b3..1761d47fa 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -347,6 +347,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
: ModCount(-1), duration_m(60), duration_h(60*60), duration_d(60*60*24), duration_w(60*60*24*7), duration_y(60*60*24*365), GlobalCulls(this)
{
#ifdef WINDOWS
+ ClearConsole();
WSADATA wsadata;
WSAStartup(MAKEWORD(2,0), &wsadata);
#endif
@@ -557,8 +558,14 @@ InspIRCd::InspIRCd(int argc, char** argv)
this->WritePID(Config->PID);
#ifdef WINDOWS
- InitIPC();
+ InitIPC();
+
g_starting = false;
+
+ // remove the console if in no-fork
+ if(!Config->nofork)
+ FreeConsole();
+
#endif
}
@@ -979,11 +986,14 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
#else
CheckIPC(this);
- uptime = Time() - startup_time;
- stime = gmtime(&uptime);
- snprintf(window_title, 100, "InspIRCd - %u clients, %u accepted connections - Up %u days, %.2u:%.2u:%.2u",
- LocalUserCount(), stats->statsAccept, stime->tm_yday, stime->tm_hour, stime->tm_min, stime->tm_sec);
- SetConsoleTitle(window_title);
+ if(Config->nofork)
+ {
+ uptime = Time() - startup_time;
+ stime = gmtime(&uptime);
+ snprintf(window_title, 100, "InspIRCd - %u clients, %u accepted connections - Up %u days, %.2u:%.2u:%.2u",
+ LocalUserCount(), stats->statsAccept, stime->tm_yday, stime->tm_hour, stime->tm_min, stime->tm_sec);
+ SetConsoleTitle(window_title);
+ }
#endif
}
@@ -1027,9 +1037,6 @@ int InspIRCd::Run()
int main(int argc, char** argv)
{
-#ifdef WINDOWS
- ClearConsole();
-#endif
SI = new InspIRCd(argc, argv);
SI->Run();
delete SI;