diff options
author | Sadie Powell <sadie@witchery.services> | 2024-03-19 15:39:41 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-03-19 15:51:55 +0000 |
commit | bfed2e1bf5cfb250e17e91566546b38b4b9a34d8 (patch) | |
tree | ecf5ba2049ae1752cff533e060d2dce50983c04e /src/init.cpp | |
parent | e488f294a116224d8c7f89c6c4ebad2356ba7814 (diff) |
Use paths relative to data/conf in the config file.
This was done in some places already but not consistently.
Closes #349.
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); |