bool ConfigManager::checkForUserUpdate(RollBackCheckType how) Called to check if the file has been changed by the user. Timestamps are compared to see if a change occurred
| 384 | // Called to check if the file has been changed by the user. |
| 385 | // Timestamps are compared to see if a change occurred |
| 386 | bool |
| 387 | FileManager::ConfigManager::checkForUserUpdate(FileManager::RollBackCheckType how) |
| 388 | { |
| 389 | struct stat fileInfo; |
| 390 | bool result; |
| 391 | |
| 392 | ink_mutex_acquire(&fileAccessLock); |
| 393 | |
| 394 | if (this->statFile(&fileInfo) < 0) { |
| 395 | ink_mutex_release(&fileAccessLock); |
| 396 | return false; |
| 397 | } |
| 398 | |
| 399 | if (fileLastModified < TS_ARCHIVE_STAT_MTIME(fileInfo)) { |
| 400 | if (how == FileManager::ROLLBACK_CHECK_AND_UPDATE) { |
| 401 | fileLastModified = TS_ARCHIVE_STAT_MTIME(fileInfo); |
| 402 | // TODO: syslog???? |
| 403 | } |
| 404 | result = true; |
| 405 | } else { |
| 406 | result = false; |
| 407 | } |
| 408 | |
| 409 | ink_mutex_release(&fileAccessLock); |
| 410 | return result; |
| 411 | } |
no test coverage detected