Resource leakage on opened file.
The opened file descriptor and inotify won't be released, if the synced
file generate in time. This happens occasionally, but the leakage will
lead to journal log failure and will not able to use inotify after a
long period run.
Change-Id: I09cca72c88091ebcf1bb7ddb7df04ee1d2b2d7d6
Signed-off-by: Troy Lee <troy.lee@vertiv.com>
diff --git a/log_manager.cpp b/log_manager.cpp
index fea2529..569413a 100644
--- a/log_manager.cpp
+++ b/log_manager.cpp
@@ -454,7 +454,7 @@
auto timestamp = std::stoll(timestampStr);
if (timestamp >= start)
{
- return;
+ break;
}
}
@@ -473,7 +473,7 @@
if (method.is_method_error())
{
log<level::ERR>("Failed to kill journal service");
- return;
+ break;
}
continue;
}