* Closes the PID file. Does nothing if the PID file is not currently open. */
| 1089 | * Closes the PID file. Does nothing if the PID file is not currently open. |
| 1090 | */ |
| 1091 | void 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 |