X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=0fa90fca5b6028ed764f94f6878d470b530320cb;hb=c7a26bc21629ddd4103dac1ff7f9acf45a2c4d35;hp=766aeaf8ef05d92cb4979252aac8423ce7825a0c;hpb=7fec670c9b378f5c8470204ba36a284a424a11c7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 766aeaf8e..0fa90fca5 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -294,7 +294,7 @@ bool InspIRCd::DaemonSeed() #endif } -void InspIRCd::WritePID(const std::string &filename) +void InspIRCd::WritePID(const std::string& filename, bool exitonfail) { #ifndef _WIN32 std::string fname(filename); @@ -307,10 +307,12 @@ void InspIRCd::WritePID(const std::string &filename) outfile.close(); } else - { - std::cout << "Failed to write PID-file '" << fname << "', exiting." << std::endl; - this->Logs->Log("STARTUP",DEFAULT,"Failed to write PID-file '%s', exiting.",fname.c_str()); - Exit(EXIT_STATUS_PID); + { + if (exitonfail) + std::cout << "Failed to write PID-file '" << fname << "', exiting." << std::endl; + this->Logs->Log("STARTUP",DEFAULT,"Failed to write PID-file '%s'%s",fname.c_str(), (exitonfail ? ", exiting." : "")); + if (exitonfail) + Exit(EXIT_STATUS_PID); } #endif } @@ -814,11 +816,11 @@ int InspIRCd::Run() /* Allow a buffer of two seconds drift on this so that ntpdate etc dont harass admins */ if (TIME.tv_sec < OLDTIME - 2) { - SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %lu secs.", (unsigned long)OLDTIME-TIME.tv_sec); + SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %lu secs.", (unsigned long)(OLDTIME-TIME.tv_sec)); } else if (TIME.tv_sec > OLDTIME + 2) { - SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is jumping FORWARDS! Clock skipped %lu secs.", (unsigned long)TIME.tv_sec - OLDTIME); + SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is jumping FORWARDS! Clock skipped %lu secs.", (unsigned long)(TIME.tv_sec - OLDTIME)); } OLDTIME = TIME.tv_sec;