summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTroy Lee <troy.lee@vertiv.com>2019-11-19 14:34:56 +0800
committerMatt Spinler <spinler@us.ibm.com>2019-12-09 18:44:06 +0000
commitb7f392a23e05a76a1dcba6d1a417715ebec4f257 (patch)
treeccb40c8554e9f9c0ac022fae0b677f721fa6fe07
parent0ff00485b1e8f9b57eafc2065b3b8cd82471c58d (diff)
downloadphosphor-logging-b7f392a23e05a76a1dcba6d1a417715ebec4f257.tar.gz
phosphor-logging-b7f392a23e05a76a1dcba6d1a417715ebec4f257.zip
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>
-rw-r--r--log_manager.cpp4
1 files changed, 2 insertions, 2 deletions
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 @@ void Manager::journalSync()
auto timestamp = std::stoll(timestampStr);
if (timestamp >= start)
{
- return;
+ break;
}
}
@@ -473,7 +473,7 @@ void Manager::journalSync()
if (method.is_method_error())
{
log<level::ERR>("Failed to kill journal service");
- return;
+ break;
}
continue;
}
OpenPOWER on IntegriCloud