diff --git a/SystemServices/CHANGELOG.md b/SystemServices/CHANGELOG.md index 709e3bccca..40846f6a55 100644 --- a/SystemServices/CHANGELOG.md +++ b/SystemServices/CHANGELOG.md @@ -15,6 +15,10 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [2.2.1] - 2024-05-22 +### Fixed +- Fixed stuck cSettings::readFromFile() if file is a directory. + ## [2.2.0] - 2024-05-16 ### Deprecated - Deprecated uploadLogs API diff --git a/SystemServices/SystemServices.cpp b/SystemServices/SystemServices.cpp index c3acc1e778..4567410578 100644 --- a/SystemServices/SystemServices.cpp +++ b/SystemServices/SystemServices.cpp @@ -67,7 +67,7 @@ using namespace std; #define API_VERSION_NUMBER_MAJOR 2 #define API_VERSION_NUMBER_MINOR 2 -#define API_VERSION_NUMBER_PATCH 0 +#define API_VERSION_NUMBER_PATCH 1 #define MAX_REBOOT_DELAY 86400 /* 24Hr = 86400 sec */ #define TR181_FW_DELAY_REBOOT "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AutoReboot.fwDelayReboot" diff --git a/helpers/UtilsfileExists.h b/helpers/UtilsfileExists.h index 9173457d32..13fc840c8f 100644 --- a/helpers/UtilsfileExists.h +++ b/helpers/UtilsfileExists.h @@ -6,6 +6,6 @@ namespace Utils { inline bool fileExists(const char* pFileName) { struct stat fileStat; - return 0 == stat(pFileName, &fileStat); + return 0 == stat(pFileName, &fileStat) && S_IFREG == (fileStat.st_mode & S_IFMT); } } diff --git a/helpers/cSettings.h b/helpers/cSettings.h index d6590e16b4..2c34f14067 100644 --- a/helpers/cSettings.h +++ b/helpers/cSettings.h @@ -195,8 +195,7 @@ class cSettings { } fstream ifile(filename, ios::in); if (ifile) { - while (!ifile.eof()) { - std::getline(ifile, content); + while (std::getline(ifile, content)) { size_t pos = content.find_last_of("="); if (std::string::npos != pos) { data[(content.substr(0, pos).c_str())] = content.substr(pos + 1, std::string::npos);