From 92ebeef3b95f989ad3f64e428c5da71be1a6ed97 Mon Sep 17 00:00:00 2001 From: prozacx Date: Fri, 9 Sep 2005 04:47:32 +0000 Subject: [PATCH] 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 --- znc.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/znc.cpp b/znc.cpp index f1f155bd..d68201f8 100644 --- a/znc.cpp +++ b/znc.cpp @@ -368,12 +368,12 @@ bool CZNC::WriteNewConfig(const CString& sConfig) { vector 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; }