From 73cbdad9fd47ce7b7f7f2eb490748d63b60e1850 Mon Sep 17 00:00:00 2001 From: "Guo, Jade" Date: Tue, 31 Oct 2023 13:27:02 +0800 Subject: [PATCH] Correct error messages Always got an incorrect error message of thermal HAL before. Fix it in this patch. Tracked-On: OAM-113025 Signed-off-by: Guo, Jade --- thermal/Thermal.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/thermal/Thermal.cpp b/thermal/Thermal.cpp index 3a72a53..578edcf 100644 --- a/thermal/Thermal.cpp +++ b/thermal/Thermal.cpp @@ -209,7 +209,7 @@ std::string getThermalZoneCPUTemperaturePath(){ if (!thermalType.empty()) { if (thermalType == "x86_pkg_temp") { return thermalZonePath + "/temp"; - } + } } } return ""; @@ -222,9 +222,10 @@ static int get_soc_pkg_temperature(float* temp) FILE *file = NULL; std::string thermalTypePath = getThermalZoneCPUTemperaturePath(); - ALOGE("Thermal zone path Temp path for x86_pkg_temp:%s", thermalTypePath.c_str()); - if(thermalTypePath.empty()) + if (thermalTypePath.empty()) { + ALOGE("%s: failed to get thermalTypePath: %s", __func__, strerror(errno)); return -errno; + } file = fopen(thermalTypePath.c_str(), "r"); if (file == NULL) {