mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Improve error log messages when saving settings fails
Log separate messages for `io_sync` error, `io_close` error and general write errors.
This commit is contained in:
parent
43b1e5cb1f
commit
a80d875e85
|
@ -496,19 +496,27 @@ bool CConfigManager::Save()
|
|||
WriteLine(pCommand);
|
||||
}
|
||||
|
||||
if(m_Failed)
|
||||
{
|
||||
log_error("config", "ERROR: writing to %s failed", aConfigFileTmp);
|
||||
}
|
||||
|
||||
if(io_sync(m_ConfigFile) != 0)
|
||||
{
|
||||
m_Failed = true;
|
||||
log_error("config", "ERROR: synchronizing %s failed", aConfigFileTmp);
|
||||
}
|
||||
|
||||
if(io_close(m_ConfigFile) != 0)
|
||||
{
|
||||
m_Failed = true;
|
||||
log_error("config", "ERROR: closing %s failed", aConfigFileTmp);
|
||||
}
|
||||
|
||||
m_ConfigFile = 0;
|
||||
|
||||
if(m_Failed)
|
||||
{
|
||||
log_error("config", "ERROR: writing to %s failed", aConfigFileTmp);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue