+changed = true;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::Flush(const std::string & path) const
+{
+ofstream f(path.c_str());
+if (!f.is_open())
+ {
+ error = EIO;
+ return EIO;
+ }
+
+map<string, string>::const_iterator it = param_val.begin();
+while (it != param_val.end())
+ {
+ f << it->first << "=" << it->second << "\n";
+ ++it;
+ }
+
+f.close();
+return 0;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::Flush() const
+{
+if (!changed)
+ return 0;
+
+std::string pid;
+x2str(getpid(), pid);
+
+if (Flush(fileName + "." + pid))
+ return -1;
+
+if (rename((fileName + "." + pid).c_str(), fileName.c_str()))
+ return -1;
+
+changed = false;
+