Skip to content

Commit

Permalink
Correct error messages
Browse files Browse the repository at this point in the history
Always got an incorrect error message of thermal HAL before.
Fix it in this patch.

Tracked-On: OAM-113025
Signed-off-by: Guo, Jade <jade.guo@intel.com>
  • Loading branch information
jiaxuan-guo committed Nov 2, 2023
1 parent 7445d51 commit 73cbdad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions thermal/Thermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ std::string getThermalZoneCPUTemperaturePath(){
if (!thermalType.empty()) {
if (thermalType == "x86_pkg_temp") {
return thermalZonePath + "/temp";
}
}
}
}
return "";
Expand All @@ -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) {
Expand Down

0 comments on commit 73cbdad

Please sign in to comment.