summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorDaniel De Graaf <danieldg@inspircd.org>2011-07-17 18:52:23 -0400
committerDaniel De Graaf <danieldg@inspircd.org>2011-07-17 18:52:23 -0400
commita75efd417098dada0c4170a27a1bf76f7f55b26e (patch)
treea34961248cafae751e8c2c5dd3344129fbe272f8 /src/configreader.cpp
parente245dbbad7e91f232482374e9166f18782eaafa0 (diff)
Only write pidfile if we have parsed a valid configuration
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp7
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