Display a better error message if znc.conf cannot be opened

If znc.conf was a regular file which we just couldn't open (chmod 0), ZNC
reported that it was already running on this config.
This patch fixes this message.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1033 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-04-29 12:15:48 +00:00
parent c4f1eb3da3
commit fe361f7a18
2 changed files with 15 additions and 2 deletions
+7 -1
View File
@@ -903,7 +903,13 @@ bool CZNC::DoRehash(CString& sError)
return false;
}
if (!m_LockFile.TryExLock(m_sConfigFile)) {
if (!m_LockFile.Open(m_sConfigFile)) {
sError = "Can not open config file";
CUtils::PrintStatus(false, sError);
return false;
}
if (!m_LockFile.TryExLock()) {
sError = "ZNC is already running on this config.";
CUtils::PrintStatus(false, sError);
return false;