diff options
author | Troy Lee <troy.lee@vertiv.com> | 2019-11-19 14:34:56 +0800 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2019-12-09 18:44:06 +0000 |
commit | b7f392a23e05a76a1dcba6d1a417715ebec4f257 (patch) | |
tree | ccb40c8554e9f9c0ac022fae0b677f721fa6fe07 | |
parent | 0ff00485b1e8f9b57eafc2065b3b8cd82471c58d (diff) | |
download | phosphor-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.cpp | 4 |
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; } |