]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Release v2.0.22
[user/henk/code/inspircd.git] / src / inspircd.cpp
index 656be220f6c60d37469dd88f793a5b00bcc7daa2..0fa90fca5b6028ed764f94f6878d470b530320cb 100644 (file)
@@ -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);
+       {\r
+               if (exitonfail)\r
+                       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." : ""));\r
+               if (exitonfail)
+                       Exit(EXIT_STATUS_PID);\r
        }
 #endif
 }