From 3c19bd7b6603a26cf365a1a5204dfbc7adc34d98 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 2 Jun 2007 23:44:56 +0000 Subject: 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 --- src/inspircd.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src') 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; -- cgit v1.2.3