Check for errors while writing the config

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-03-31 18:21:36 +02:00
parent bff969f404
commit 7f3e55e72f

View File

@@ -513,6 +513,11 @@ bool CZNC::WriteConfig() {
// If Sync() fails... well, let's hope nothing important breaks..
m_LockFile.Sync();
if (m_LockFile.HadError()) {
DEBUG("Error while writing the config, errno says: " + CString(strerror(errno)));
return false;
}
// We wrote to a temporary name, move it to the right place
if (!m_LockFile.Move(GetConfigFile(), true))
return false;