X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fserver.cpp;h=d05ece8a45ac2c7f86bce4308dbb3fcc598687c9;hb=4e3d7a6e30eadf714483994681b8b2534229f4a8;hp=4bd81a6d1ba970bd09b3f4b24d5fd64bc6d64998;hpb=74ee9af96639323d852a8b15be72ee9974e0a826;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/server.cpp b/src/server.cpp index 4bd81a6d1..d05ece8a4 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -27,11 +27,15 @@ void InspIRCd::SignalHandler(int signal) { +#ifdef _WIN32 + if (signal == SIGTERM) +#else if (signal == SIGHUP) { Rehash("Caught SIGHUP"); } else if (signal == SIGTERM) +#endif { Exit(signal); } @@ -39,18 +43,13 @@ void InspIRCd::SignalHandler(int signal) void InspIRCd::Exit(int status) { -#ifdef WINDOWS - if (WindowsIPC) - delete WindowsIPC; +#ifdef _WIN32 SetServiceStopped(status); #endif - if (this) - { - this->SendError("Exiting with status " + ConvToStr(status) + " (" + std::string(ExitCodes[status]) + ")"); - this->Cleanup(); - delete this; - ServerInstance = NULL; - } + this->SendError("Exiting with status " + ConvToStr(status) + " (" + std::string(ExitCodes[status]) + ")"); + this->Cleanup(); + delete this; + ServerInstance = NULL; exit (status); } @@ -70,9 +69,12 @@ std::string InspIRCd::GetVersionString(bool operstring) { char versiondata[MAXBUF]; if (operstring) - snprintf(versiondata,MAXBUF,"%s %s :%s [%s,%s,%s]",VERSION,Config->ServerName.c_str(),SYSTEM,REVISION,SE->GetName().c_str(),Config->sid.c_str()); + { + std::string sename = SE->GetName(); + snprintf(versiondata,MAXBUF,"%s %s :%s [%s,%s,%s]",VERSION, Config->ServerName.c_str(), SYSTEM,REVISION, sename.c_str(), Config->sid.c_str()); + } else - snprintf(versiondata,MAXBUF,"InspIRCd-2.0 %s :%s",Config->ServerName.c_str(),Config->CustomVersion.c_str()); + snprintf(versiondata,MAXBUF,"%s %s :%s",BRANCH,Config->ServerName.c_str(),Config->CustomVersion.c_str()); return versiondata; }