From 53b146f1502b64a31c098025eb3f54ea8f9e1574 Mon Sep 17 00:00:00 2001 From: ilho kim Date: Fri, 20 Oct 2023 15:24:46 +0900 Subject: [PATCH] Remove code that may fall info infinite loop Change-Id: I8ebbac18e15ec68c0dc215ec619527b5aa93fbca Signed-off-by: ilho kim --- src/wgt/step/encryption/step_encrypt_resources.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wgt/step/encryption/step_encrypt_resources.cc b/src/wgt/step/encryption/step_encrypt_resources.cc index 40b6781..448d2f4 100644 --- a/src/wgt/step/encryption/step_encrypt_resources.cc +++ b/src/wgt/step/encryption/step_encrypt_resources.cc @@ -36,9 +36,9 @@ const std::set encryptSet { ".html", ".htm", ".css", ".js"}; FILE* OpenFile(const bf::path& path, const std::string& mode) { FILE* result = nullptr; - do { - result = fopen(path.c_str(), mode.c_str()); - } while ((nullptr == result)); + result = fopen(path.c_str(), mode.c_str()); + if (result == nullptr) + LOG(ERROR) << "open [" << path << "] fail, errno : " << errno; return result; } -- 2.7.4