From 7f3e55e72fd082d85f82cb523411df58d268a2fc Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 31 Mar 2011 18:21:36 +0200 Subject: [PATCH] Check for errors while writing the config Signed-off-by: Uli Schlachter --- znc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/znc.cpp b/znc.cpp index c8616f9f..ec0e7582 100644 --- a/znc.cpp +++ b/znc.cpp @@ -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;