mirror of
https://github.com/znc/znc.git
synced 2026-05-01 11:02:27 +02:00
Don't try the lock until we know the file exists
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@478 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
10
znc.cpp
10
znc.cpp
@@ -368,12 +368,12 @@ bool CZNC::WriteNewConfig(const CString& sConfig) {
|
||||
vector<CString> vsLines;
|
||||
bool bAnswer = false;
|
||||
|
||||
if (!m_LockFile.TryExLock(m_sConfigFile, 50)) {
|
||||
CUtils::PrintError("ZNC is currently running on this config.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (CFile::Exists(sConfigFile)) {
|
||||
if (!m_LockFile.TryExLock(sConfigFile, 50)) {
|
||||
CUtils::PrintError("ZNC is currently running on this config.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CUtils::GetBoolInput("This config already exists. Would you like to overwrite it?", false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user