| 81 | } |
| 82 | |
| 83 | static void HandleLegacyDefines() |
| 84 | { |
| 85 | #ifdef _WIN32 |
| 86 | String dataPrefix = Utility::GetIcingaDataPath(); |
| 87 | #endif /* _WIN32 */ |
| 88 | |
| 89 | Value localStateDir = Configuration::LocalStateDir; |
| 90 | |
| 91 | if (!localStateDir.IsEmpty()) { |
| 92 | Log(LogWarning, "icinga-app") |
| 93 | << "Please do not set the deprecated 'LocalStateDir' constant," |
| 94 | << " use the 'DataDir', 'LogDir', 'CacheDir' and 'SpoolDir' constants instead!" |
| 95 | << " For compatibility reasons, these are now set based on the 'LocalStateDir' constant."; |
| 96 | |
| 97 | #ifdef _WIN32 |
| 98 | Configuration::DataDir = localStateDir + "\\lib\\icinga2"; |
| 99 | Configuration::LogDir = localStateDir + "\\log\\icinga2"; |
| 100 | Configuration::CacheDir = localStateDir + "\\cache\\icinga2"; |
| 101 | Configuration::SpoolDir = localStateDir + "\\spool\\icinga2"; |
| 102 | } else { |
| 103 | Configuration::LocalStateDir = dataPrefix + "\\var"; |
| 104 | #else /* _WIN32 */ |
| 105 | Configuration::DataDir = localStateDir + "/lib/icinga2"; |
| 106 | Configuration::LogDir = localStateDir + "/log/icinga2"; |
| 107 | Configuration::CacheDir = localStateDir + "/cache/icinga2"; |
| 108 | Configuration::SpoolDir = localStateDir + "/spool/icinga2"; |
| 109 | } else { |
| 110 | Configuration::LocalStateDir = ICINGA_LOCALSTATEDIR; |
| 111 | #endif /* _WIN32 */ |
| 112 | } |
| 113 | |
| 114 | Value sysconfDir = Configuration::SysconfDir; |
| 115 | if (!sysconfDir.IsEmpty()) { |
no test coverage detected