mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Check for errors while writing the config
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
5
znc.cpp
5
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;
|
||||
|
||||
Reference in New Issue
Block a user