use system folders if run as service

This commit is contained in:
orignal 2014-10-17 09:55:41 -04:00
parent 2cd8d0c0b7
commit 02c51b0980
5 changed files with 18 additions and 5 deletions

View file

@ -74,7 +74,7 @@ namespace i2p
}
// Pidfile
pidfile = i2p::util::filesystem::GetDataDir().string();
pidfile = IsService () ? "/var/run" : i2p::util::filesystem::GetDataDir().string();
pidfile.append("/i2pd.pid");
pidFilehandle = open(pidfile.c_str(), O_RDWR | O_CREAT, 0600);
if (pidFilehandle == -1)