1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 13:16:38 +02:00

Fix write_pidfile on Windows.

Microsoft's documentation lies again.
This commit is contained in:
Sadie Powell
2024-02-27 10:05:32 +00:00
parent 642e68f53a
commit 9f6d378755
+5 -1
View File
@@ -221,7 +221,11 @@ static void write_pidfile()
std::ofstream stream(pidfile.str());
if (!stream.is_open())
throw CoreException("Can not write to PID file " + pidfile);
stream << getpid() << std::endl;
#ifdef _WIN32
stream << GetCurrentProcessId() << std::endl;
#else
stream << getpid() << std::endl;
#endif
atexit(remove_pidfile);
}