diff options
Diffstat (limited to 'src/components/config_profile/src/ini_file.cc')
-rw-r--r-- | src/components/config_profile/src/ini_file.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc index 1c30c8b201..3245b096cb 100644 --- a/src/components/config_profile/src/ini_file.cc +++ b/src/components/config_profile/src/ini_file.cc @@ -39,6 +39,8 @@ #include <limits.h> #include <stdint.h> +#include "utils/logger.h" + #ifndef _WIN32 #include <unistd.h> #else @@ -53,6 +55,8 @@ namespace profile { +CREATE_LOGGERPTR_GLOBAL(logger_, "Profile") + char* ini_write_inst(const char* fname, uint8_t flag) { FILE* fp = 0; @@ -272,9 +276,11 @@ char ini_write_value(const char* fname, fclose(wr_fp); fclose(rd_fp); - remove(fname); if (0 != rename(temp_fname, fname)) { - remove(temp_fname); + if (0 != remove(temp_fname)) { + LOG4CXX_WARN_WITH_ERRNO( + logger_, "Unable to remove temp file: " << std::string(temp_fname)); + } return FALSE; } |