From a5ccbbbd404261c14ea57b0713717990a38f0e93 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 23 Feb 2013 15:42:22 +0100 Subject: [PATCH] configfile: don't do a full sync() after saving --- lib/libconfigfile/configfile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libconfigfile/configfile.cpp b/lib/libconfigfile/configfile.cpp index 4c303cde7..4814cdda9 100644 --- a/lib/libconfigfile/configfile.cpp +++ b/lib/libconfigfile/configfile.cpp @@ -91,17 +91,18 @@ bool CConfigFile::loadConfig(const std::string & filename) bool CConfigFile::saveConfig(const char * const filename) { - std::ofstream configFile(filename); + std::fstream configFile(filename); if (configFile != NULL) { + std::cout << "[ConfigFile] saving " << filename << std::endl; for (ConfigDataMap::const_iterator it = configData.begin(); it != configData.end(); ++it) { configFile << it->first << "=" << it->second << std::endl; } + configFile.sync(); configFile.close(); - sync(); chmod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);