summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-08-17 12:49:48 +0200
committerAttila Molnar <attilamolnar@hush.com>2016-08-17 12:49:48 +0200
commitb9e11915a976daaf790ebc763aff56e19fd49e0f (patch)
tree7c69dc9427a8a0470ff12f772846b956e747bf78 /src/inspircd.cpp
parentf9fd78c01623514a060c607534fc52cb73140200 (diff)
parentc7a26bc21629ddd4103dac1ff7f9acf45a2c4d35 (diff)
Merge insp20
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index eb24cdea0..5d4d8081f 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -194,7 +194,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);
@@ -208,9 +208,11 @@ void InspIRCd::WritePID(const std::string &filename)
}
else
{
- std::cout << "Failed to write PID-file '" << fname << "', exiting." << std::endl;
- this->Logs->Log("STARTUP", LOG_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", LOG_DEFAULT, "Failed to write PID-file '%s'%s", fname.c_str(), (exitonfail ? ", exiting." : ""));
+ if (exitonfail)
+ Exit(EXIT_STATUS_PID);
}
#endif
}