diff options
author | Daniel De Graaf <danieldg@inspircd.org> | 2011-07-17 18:52:23 -0400 |
---|---|---|
committer | Daniel De Graaf <danieldg@inspircd.org> | 2011-07-17 18:52:23 -0400 |
commit | a75efd417098dada0c4170a27a1bf76f7f55b26e (patch) | |
tree | a34961248cafae751e8c2c5dd3344129fbe272f8 | |
parent | e245dbbad7e91f232482374e9166f18782eaafa0 (diff) |
Only write pidfile if we have parsed a valid configuration
-rw-r--r-- | src/configreader.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index f02c5bdbb..6ef5105aa 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -657,12 +657,13 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) errstr << ce.GetReason(); } - // write once here, to try it out and make sure its ok - ServerInstance->WritePID(this->PID); - // Check errors before dealing with failed binds, since continuing on failed bind is wanted in some circumstances. valid = errstr.str().empty(); + // write once here, to try it out and make sure its ok + if (valid) + ServerInstance->WritePID(this->PID); + if (old) { // On first run, ports are bound later on |