MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ClosePidFile

Method ClosePidFile

lib/base/application.cpp:1091–1105  ·  view source on GitHub ↗

* Closes the PID file. Does nothing if the PID file is not currently open. */

Source from the content-addressed store, hash-verified

1089 * Closes the PID file. Does nothing if the PID file is not currently open.
1090 */
1091void Application::ClosePidFile(bool unlink)
1092{
1093 ObjectLock olock(this);
1094
1095 if (m_PidFile) {
1096 if (unlink) {
1097 String pidpath = Configuration::PidPath;
1098 ::unlink(pidpath.CStr());
1099 }
1100
1101 fclose(m_PidFile);
1102 }
1103
1104 m_PidFile = nullptr;
1105}
1106
1107/**
1108 * Checks if another process currently owns the pidfile and read it

Callers 1

RunMethod · 0.80

Calls 1

CStrMethod · 0.80

Tested by

no test coverage detected