Skip to content

Commit

Permalink
Merge pull request #5290 from sborushevsky/RDKTV-30706_main
Browse files Browse the repository at this point in the history
RDKTV-30706 : Added check if that is the file to fileExists()
  • Loading branch information
anand-ky authored May 22, 2024
2 parents 773af4c + cb50077 commit 047d458
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions SystemServices/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion SystemServices/SystemServices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion helpers/UtilsfileExists.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
3 changes: 1 addition & 2 deletions helpers/cSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 047d458

Please sign in to comment.