Skip to content

Commit

Permalink
Linux: Be a little less verbose when writing settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ksperling-apple committed Aug 13, 2024
1 parent b10b01c commit ff0a097
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/platform/Linux/CHIPLinuxStorageIni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,13 @@ CHIP_ERROR ChipLinuxStorageIni::CommitConfig(const std::string & configFile)
if (fd != -1)
{
std::ofstream ofs;

ChipLogProgress(DeviceLayer, "writing settings to file (%s)", tmpPath.c_str());

ofs.open(tmpPath, std::ofstream::out | std::ofstream::trunc);
mConfigStore.generate(ofs);

close(fd);

if (rename(tmpPath.c_str(), configFile.c_str()) == 0)
{
ChipLogProgress(DeviceLayer, "renamed tmp file to file (%s)", configFile.c_str());
ChipLogDetail(DeviceLayer, "wrote settings to %s", configFile.c_str());
}
else
{
Expand Down

0 comments on commit ff0a097

Please sign in to comment.