diff options
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 7cb136844..3881d92e8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -218,7 +218,10 @@ static void remove_pidfile() static void write_pidfile() { - const auto pidfile = Config->GetBlock("serverinfo")->Get<const Anope::string>("pid"); + auto pidfile = Anope::ExpandData(Config->GetBlock("serverinfo")->Get<const Anope::string>("pid")); + if (pidfile.empty()) + return; + std::ofstream stream(pidfile.str()); if (!stream.is_open()) throw CoreException("Can not write to PID file " + pidfile); |