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:
+5
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user