Module: check_mk
Branch: master
Commit: 3315406fd42a87876da982a42f45f9a8ea61a44d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3315406fd42a87…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Mar 8 09:37:37 2017 +0100
std::filesystems::directory_iterator returns full paths, not filenames.
Change-Id: I5fc31f3562e7a5b4bf0ead423b7e1c637521a264
---
livestatus/src/LogCache.cc | 2 +-
livestatus/src/LogwatchListColumn.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/livestatus/src/LogCache.cc b/livestatus/src/LogCache.cc
index a59b6fb..f583513 100644
--- a/livestatus/src/LogCache.cc
+++ b/livestatus/src/LogCache.cc
@@ -98,7 +98,7 @@ void LogCache::updateLogfileIndex() {
fs::path dirpath = log_archive_path;
try {
for (const auto &entry : fs::directory_iterator(dirpath)) {
- scanLogfile(dirpath / entry.path(), false);
+ scanLogfile(entry.path(), false);
}
} catch (const fs::filesystem_error &e) {
Warning(_logger) << "error while iterating directory: " <<
e.what();
diff --git a/livestatus/src/LogwatchListColumn.cc b/livestatus/src/LogwatchListColumn.cc
index fbf08b0..bf3c7d1 100644
--- a/livestatus/src/LogwatchListColumn.cc
+++ b/livestatus/src/LogwatchListColumn.cc
@@ -56,7 +56,7 @@ void LogwatchListColumn::output(void *row, RowRenderer &r,
try {
for (const auto &entry : fs::directory_iterator(
_logwatch_path + pnp_cleanup(host_name))) {
- l.output(entry.path().string());
+ l.output(entry.path().filename().string());
}
} catch (const fs::filesystem_error &e) {
Warning(logger()) << "error while iterating directory: "